Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: standardize usage of terms CSS and Sass #3290

Merged
merged 3 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/CODING_STANDARDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if (!this.getAttribute('tabindex')) {
In TypeScript code, use JsDoc-style comments for descriptions (on classes, members, etc.) and
use `//` style comments for everything else (explanations, background info, etc.).

In SCSS code, always use `//` style comments.
In Sass code, always use `//` style comments.

In HTML code, use `<!-- ... -->` comments, which will be stripped when packaging a build.

Expand Down Expand Up @@ -504,7 +504,7 @@ Also define CSS variables in :host.
}
```

#### Use/Check existing CSS variables and SCSS mixins/functions
#### Use/Check existing CSS variables and Sass mixins/functions

The `@sbb-esta/lyne-design-tokens` package provides global design tokens/CSS variables,
which are used/configured in our code base (see `src/elements/core/styles/core/variables.scss`).
Expand All @@ -523,7 +523,7 @@ If a global variable is missing, create an issue or pull request in
#### Use the lowest specificity possible

Always prioritize lower specificity over other factors. Most style definitions should consist of a
single element or css selector plus necessary state modifiers. **Avoid SCSS nesting for the sake of
single element or CSS selector plus necessary state modifiers. **Avoid Sass nesting for the sake of
code organization.** This will allow users to much more easily override styles.

For example, rather than doing this:
Expand Down
2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ This project publishes the following package:

### Styling

This project uses [SASS](https://sass-lang.com/) for styling the components.
This project uses [Sass](https://sass-lang.com/) for styling the components.

## Language

Expand Down
2 changes: 1 addition & 1 deletion docs/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
We recommend using `nvm` to manage your node versions.
2. From the root of the project, run `yarn` to install the dependencies.

There are currently some unknown problems with developing on Windows when working with SASS,
There are currently some unknown problems with developing on Windows when working with Sass,
so we recommend using WSL2 to develop on Windows machines.

To bring up a local server, run `yarn start`. This will automatically watch for changes
Expand Down
10 changes: 5 additions & 5 deletions docs/GETTING_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,10 @@ Some design tokens are responsive: they change their value depending on the curr
> There is a corresponding responsive CSS variable without the `-breakpoint` suffix,
> e.g. `sbb-spacing-responsive-s` which should be used.

### SASS Mixins
### Sass Mixins

Lyne Components provides various SASS mixins which can be used by consumers.
For available SASS mixins, check [SASS Mixins](https://github.com/sbb-design-systems/lyne-components/tree/main/src/elements/core/styles/mixins).
Lyne Components provides various Sass mixins which can be used by consumers.
For available Sass mixins, check [Sass Mixins](https://github.com/sbb-design-systems/lyne-components/tree/main/src/elements/core/styles/mixins).

```scss
@use '@sbb-esta/lyne-elements' as sbb;
Expand Down Expand Up @@ -328,7 +328,7 @@ when font size changes in browsers.

Focus outlines should only be displayed when users are navigating by keyboard.
Lyne components use the CSS selector `:focus-visible`, to achieve that. Whenever you have custom interactive elements,
you should use the `:focus-visible` selector as well and include our SASS mixin `focus-outline`.
you should use the `:focus-visible` selector as well and include our Sass mixin `focus-outline`.

```scss
@use '../../core/styles' as sbb;
Expand Down Expand Up @@ -363,7 +363,7 @@ Please note, although SBB provides more fonts than `Roman`, `Bold` and `Light`,
Lyne only intends to use these three fonts.
To apply the SBB font family you can use the CSS var `var(--sbb-typo-font-family)`. However,
this only includes the family but no letter spacing, so we recommend to always
use our SASS mixins or CSS classes which contain all necessary properties.
use our Sass mixins or CSS classes which contain all necessary properties.
See [Text styles](https://lyne-storybook.app.sbb.ch/?path=/docs/styles-typography--docs) for what's available.

```html
Expand Down
2 changes: 1 addition & 1 deletion docs/REVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Depending on the circumstances, additional options might be considered.
- ⚠️ Is every value from a design token and if not, well documented?
- Are modern style properties used (e.g. gap, inset, margin-block, padding-inline, etc.)?
- Are there as little style definitions as possible (e.g. using gap instead of exceptions for last-child, etc.)?
- Do the css class names follow BEM and have the sbb prefix?
- Do the CSS class names follow BEM and have the sbb prefix?
- Does the visual output match the Figma spec (also confirmed with UX)?

#### Accessibility
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

:host {
// Use !important here to not interfere with Firefox focus ring definition
// which appears in normalize css of several frameworks.
// which appears in normalize CSS of several frameworks.
outline: none !important;
display: block;

Expand Down
2 changes: 1 addition & 1 deletion src/elements/button/accent-button-link/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The component can be displayed in `disabled` state using the self-named property
### Focus outline

Please make sure that the focus outline appears in the correct color if the component is used on a dark background.
You can set it by re-defining the css var on `sbb-accent-button-link` or any parent element:
You can set it by re-defining the CSS var on `sbb-accent-button-link` or any parent element:

```css
sbb-accent-button-link {
Expand Down
2 changes: 1 addition & 1 deletion src/elements/button/accent-button-static/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The component can be displayed in `disabled` state using the self-named property
### Focus outline

Please make sure that the focus outline appears in the correct color if the component is used on a dark background.
You can set it by re-defining the css var on `sbb-button-static` or any parent element:
You can set it by re-defining the CSS var on `sbb-button-static` or any parent element:

```css
sbb-accent-button-static {
Expand Down
2 changes: 1 addition & 1 deletion src/elements/button/accent-button/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The component can be displayed in `disabled` state using the self-named property
### Focus outline

Please make sure that the focus outline appears in the correct color if the component is used on a dark background.
You can set it by re-defining the css var on `sbb-accent-button` or any parent element:
You can set it by re-defining the CSS var on `sbb-accent-button` or any parent element:

```css
sbb-accent-button {
Expand Down
2 changes: 1 addition & 1 deletion src/elements/button/button-link/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ The component can be displayed in `disabled` state using the self-named property
### Focus outline

Please make sure that the focus outline appears in the correct color if the component is used on a dark background.
You can set it by re-defining the css var on `sbb-button-link` or any parent element:
You can set it by re-defining the CSS var on `sbb-button-link` or any parent element:

```css
sbb-button-link {
Expand Down
2 changes: 1 addition & 1 deletion src/elements/button/button-static/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The component can be displayed in `disabled` state using the self-named property
### Focus outline

Please make sure that the focus outline appears in the correct color if the component is used on a dark background.
You can set it by re-defining the css var on `sbb-button-static` or any parent element:
You can set it by re-defining the CSS var on `sbb-button-static` or any parent element:

```css
sbb-button-static {
Expand Down
2 changes: 1 addition & 1 deletion src/elements/button/button/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The component can be displayed in `disabled` state using the self-named property
### Focus outline

Please make sure that the focus outline appears in the correct color if the component is used on a dark background.
You can set it by re-defining the css var on `sbb-button` or any parent element:
You can set it by re-defining the CSS var on `sbb-button` or any parent element:

```css
sbb-button {
Expand Down
2 changes: 1 addition & 1 deletion src/elements/button/common/button-common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $active: ':active, [data-active]';
display: inline-block;

// Use !important here to not interfere with Firefox focus ring definition
// which appears in normalize css of several frameworks.
// which appears in normalize CSS of several frameworks.
outline: none !important;

--sbb-button-icon-size: var(--sbb-size-icon-ui-small);
Expand Down
2 changes: 1 addition & 1 deletion src/elements/button/mini-button/mini-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
display: block;

// Use !important here to not interfere with Firefox focus ring definition
// which appears in normalize css of several frameworks.
// which appears in normalize CSS of several frameworks.
outline: none !important;
}

Expand Down
2 changes: 1 addition & 1 deletion src/elements/button/mini-button/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ The component can be displayed in `disabled` state using the self-named property
### Focus outline

Please make sure that the focus outline appears in the correct color if the component is used on a dark background.
You can set it by re-defining the css var on `sbb-mini-button` or any parent element:
You can set it by re-defining the CSS var on `sbb-mini-button` or any parent element:

```css
sbb-mini-button {
Expand Down
2 changes: 1 addition & 1 deletion src/elements/button/secondary-button-link/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The component can be displayed in `disabled` state using the self-named property
### Focus outline

Please make sure that the focus outline appears in the correct color if the component is used on a dark background.
You can set it by re-defining the css var on `sbb-secondary-button-link` or any parent element:
You can set it by re-defining the CSS var on `sbb-secondary-button-link` or any parent element:

```css
sbb-secondary-button-link {
Expand Down
2 changes: 1 addition & 1 deletion src/elements/button/secondary-button-static/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The component can be displayed in `disabled` state using the self-named property
### Focus outline

Please make sure that the focus outline appears in the correct color if the component is used on a dark background.
You can set it by re-defining the css var on `sbb-button-static` or any parent element:
You can set it by re-defining the CSS var on `sbb-button-static` or any parent element:

```css
sbb-secondary-button-static {
Expand Down
2 changes: 1 addition & 1 deletion src/elements/button/secondary-button/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The component can be displayed in `disabled` state using the self-named property
### Focus outline

Please make sure that the focus outline appears in the correct color if the component is used on a dark background.
You can set it by re-defining the css var on `sbb-secondary-button` or any parent element:
You can set it by re-defining the CSS var on `sbb-secondary-button` or any parent element:

```css
sbb-secondary-button {
Expand Down
2 changes: 1 addition & 1 deletion src/elements/button/transparent-button-link/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The component can be displayed in `disabled` state using the self-named property
### Focus outline

Please make sure that the focus outline appears in the correct color if the component is used on a dark background.
You can set it by re-defining the css var on `sbb-transparent-button-link` or any parent element:
You can set it by re-defining the CSS var on `sbb-transparent-button-link` or any parent element:

```css
sbb-transparent-button-link {
Expand Down
2 changes: 1 addition & 1 deletion src/elements/button/transparent-button-static/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The component can be displayed in `disabled` state using the self-named property
### Focus outline

Please make sure that the focus outline appears in the correct color if the component is used on a dark background.
You can set it by re-defining the css var on `sbb-button-static` or any parent element:
You can set it by re-defining the CSS var on `sbb-button-static` or any parent element:

```css
sbb-transparent-button-static {
Expand Down
2 changes: 1 addition & 1 deletion src/elements/button/transparent-button/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The component can be displayed in `disabled` state using the self-named property
### Focus outline

Please make sure that the focus outline appears in the correct color if the component is used on a dark background.
You can set it by re-defining the css var on `sbb-transparent-button` or any parent element:
You can set it by re-defining the CSS var on `sbb-transparent-button` or any parent element:

```css
sbb-transparent-button {
Expand Down
2 changes: 1 addition & 1 deletion src/elements/card/common/card-action.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
display: block;

// Use !important here to not interfere with Firefox focus ring definition
// which appears in normalize css of several frameworks.
// which appears in normalize CSS of several frameworks.
outline: none !important;
position: absolute;
inset: 0;
Expand Down
2 changes: 1 addition & 1 deletion src/elements/checkbox/checkbox/checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

:host {
// Use !important here to not interfere with Firefox focus ring definition
// which appears in normalize css of several frameworks.
// which appears in normalize CSS of several frameworks.
outline: none !important;
display: inline-block;
}
Expand Down
2 changes: 1 addition & 1 deletion src/elements/core/mixins/panel-common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
display: block;

// Use !important here to not interfere with Firefox focus ring definition
// which appears in normalize css of several frameworks.
// which appears in normalize CSS of several frameworks.
outline: none !important;
}

Expand Down
22 changes: 11 additions & 11 deletions src/elements/core/styles/core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// Core variables, are always needed
:root {
// Grab css vars defined by `@sbb-esta/lyne-design-tokens` package
// Grab CSS vars defined by `@sbb-esta/lyne-design-tokens` package
@include sbb-css-tokens.lyne-design-tokens-css-variables;

& {
Expand Down Expand Up @@ -160,7 +160,7 @@ img {
object-position: var(--sbb-image-object-position);
}

// TODO: Move back to the sbb-container components when the global css refactoring happens
// TODO: Move back to the sbb-container components when the global CSS refactoring happens
sbb-container {
> [slot='image']:is(sbb-image, img),
> [slot='image'] :is(sbb-image, img) {
Expand All @@ -172,7 +172,7 @@ sbb-container {
}
}

// TODO: Move back to the sbb-flip-card-summary components when the global css refactoring happens
// TODO: Move back to the sbb-flip-card-summary components when the global CSS refactoring happens
sbb-flip-card-summary {
> [slot='image']:is(sbb-image, img),
> [slot='image'] :is(sbb-image, img) {
Expand All @@ -185,7 +185,7 @@ sbb-flip-card-summary {
}
}

// TODO: Move back to the sbb-lead-container components when the global css refactoring happens
// TODO: Move back to the sbb-lead-container components when the global CSS refactoring happens
sbb-lead-container {
> [slot='image']:is(sbb-image, img, picture),
> [slot='image'] :is(sbb-image, img, picture) {
Expand All @@ -206,7 +206,7 @@ sbb-message {

// Target the slotted `sbb-image` which are generally wrapped by a <figure> (therefore are not reachable with the :slotted)
// Apply the brightness effect on mouse hover
// TODO: Move back to the teaser components when the global css refactoring happens
// TODO: Move back to the teaser components when the global CSS refactoring happens
:is(sbb-teaser, sbb-teaser-hero, sbb-teaser-product) {
--sbb-teaser-image-brightness-hover: var(--sbb-hover-image-brightness);
--sbb-teaser-image-animation-duration: var(
Expand All @@ -229,7 +229,7 @@ sbb-message {
}
}

// TODO: Move back to the teaser components when the global css refactoring happens
// TODO: Move back to the teaser components when the global CSS refactoring happens
:is(sbb-teaser-product, sbb-teaser-product-static) {
:is(sbb-image, img) {
border-radius: 0; // Reset sbb-image border radius in order to control it from teaser product.
Expand All @@ -243,7 +243,7 @@ sbb-message {
}
}

// TODO: Move back to the teaser components when the global css refactoring happens
// TODO: Move back to the teaser components when the global CSS refactoring happens
sbb-teaser :is(sbb-image, img) {
--sbb-image-object-fit: cover;
--sbb-image-aspect-ratio: 4 / 3;
Expand All @@ -253,7 +253,7 @@ sbb-teaser :is(sbb-image, img) {
scale: var(--sbb-teaser-scale, 1);
}

// TODO: Move back to the teaser-hero components when the global css refactoring happens
// TODO: Move back to the teaser-hero components when the global CSS refactoring happens
:is(sbb-teaser-hero) {
:is(sbb-image, img) {
--sbb-image-aspect-ratio: 1 / 1;
Expand All @@ -271,17 +271,17 @@ sbb-teaser :is(sbb-image, img) {
}
}

// TODO: move to train formation after css refactoring
// TODO: move to train formation after CSS refactoring
sbb-train-formation:has(sbb-train[direction-label]) {
--sbb-train-formation-reserve-spacing-display: block;
}

// TODO: move to train formation after css refactoring
// TODO: move to train formation after CSS refactoring
sbb-train-formation:has(sbb-train-wagon[sector]) {
--sbb-train-formation-show-sectors-gap: 1;
}

// TODO: move to train formation after css refactoring
// TODO: move to train formation after CSS refactoring
sbb-train-formation:not(:has(sbb-train-wagon[label])) {
--sbb-train-formation-wagon-label-display: none;
}
Expand Down
2 changes: 1 addition & 1 deletion src/elements/core/styles/mixins/buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ $active: ':active, [data-active]';
height: fit-content;

// Use !important here to not interfere with Firefox focus ring definition
// which appears in normalize css of several frameworks.
// which appears in normalize CSS of several frameworks.
outline: none !important;

@include icon-button-variables;
Expand Down
2 changes: 1 addition & 1 deletion src/elements/footer/footer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SbbFooterElement extends SbbNegativeMixin(LitElement) {

/**
* Variants to display the footer. The default, displays the content in regular block element
* approach. The clock-columns, used a css-grid for displaying the content over different
* approach. The clock-columns, used a CSS-grid for displaying the content over different
* breakpoints.
*/
@property({ reflect: true }) public accessor variant: 'default' | 'clock-columns' = 'default';
Expand Down
4 changes: 2 additions & 2 deletions src/elements/footer/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ content related links; for these, the [sbb-link-list](/docs/elements-sbb-link-li
## Variants

There are two variants of the footer: the `variant='default'`, which displays the slotted content in regular
block element approach and the `variant='clock-columns'`, which uses a css-grid for displaying the content over different
block element approach and the `variant='clock-columns'`, which uses a CSS-grid for displaying the content over different
breakpoints.

**Note:**
Expand Down Expand Up @@ -81,7 +81,7 @@ to the content where needed (e.g. `sbb-link-list`, `sbb-link` and `sbb-divider`)
| `accessibilityTitleLevel` | `accessibility-title-level` | public | `SbbTitleLevel` | `'1'` | Level of the accessibility title, will be rendered as heading tag (e.g. h1). Defaults to level 1. |
| `expanded` | `expanded` | public | `boolean` | `false` | Whether to allow the footer content to stretch to full width. By default, the content has the appropriate page size. |
| `negative` | `negative` | public | `boolean` | `false` | Negative coloring variant flag. |
| `variant` | `variant` | public | `'default' \| 'clock-columns'` | `'default'` | Variants to display the footer. The default, displays the content in regular block element approach. The clock-columns, used a css-grid for displaying the content over different breakpoints. |
| `variant` | `variant` | public | `'default' \| 'clock-columns'` | `'default'` | Variants to display the footer. The default, displays the content in regular block element approach. The clock-columns, used a CSS-grid for displaying the content over different breakpoints. |

## Slots

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
display: block;

// Use !important here to not interfere with Firefox focus ring definition
// which appears in normalize css of several frameworks.
// which appears in normalize CSS of several frameworks.
outline: none !important;
}

Expand Down
Loading
Loading