Skip to content

Commit

Permalink
docs: standardize Sass term writing
Browse files Browse the repository at this point in the history
  • Loading branch information
jeripeierSBB committed Dec 12, 2024
1 parent fa44fdc commit d913e05
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 29 deletions.
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 src/elements/notification/notification.scss
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ $open-anim-height-to: calc(
border-radius: var(--sbb-notification-border-radius);
overflow: hidden;

// We apply SASS calculated background color as default/fallback for older browsers.
// We apply Sass calculated background color as default/fallback for older browsers.
background-color: var(--sbb-notification-type-color-sass);

// If supported, try to mix color with CSS
Expand Down
6 changes: 3 additions & 3 deletions src/storybook/styles/layout/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The page spacing ensures inline margins and controls the max-width of the page.
The `expanded`-variant has a smaller inline spacing and no max-width.

| CSS class | SASS mixin |
| CSS class | Sass mixin |
| --------------------------- | ----------------------- |
| `sbb-page-spacing` | `page-spacing` |
| `sbb-page-spacing-expanded` | `page-spacing-expanded` |
Expand All @@ -22,12 +22,12 @@ Alternatively the [sbb-container](/docs/elements-sbb-container-sbb-container--do

## Grid

The grid is available as CSS class or SASS mixin.
The grid is available as CSS class or Sass mixin.
It provides the grid from the design specifications on which you can place your elements.
The `expanded`-variant has a smaller inline spacing and no max-width.
[See CSS grid docs for full documentation of all the possibilities of placing elements on a grid.](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout)

| CSS class | SASS mixin |
| CSS class | Sass mixin |
| ------------------- | --------------- |
| `sbb-grid` | `grid` |
| `sbb-grid-expanded` | `grid-expanded` |
Expand Down
12 changes: 6 additions & 6 deletions src/storybook/styles/list/readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## sbb-list

| CSS class | SASS mixin |
| CSS class | Sass mixin |
| ---------- | ---------- |
| `sbb-list` | `list` |

Expand All @@ -10,7 +10,7 @@ The list styling doesn't define any color itself but inherits it.

### Sass usage

The SASS mixin can be included at top level or in a rule.
The Sass mixin can be included at top level or in a rule.
If used at top level it will apply rules to the native `<ul>` and `<ol>` elements.
If used inside a rule it will extend the rule with `<ul>` and `<ol>`
selectors (e.g. `.sbb-list { @include sbb.list; }` > `.sbb-list:where(ol, ul) {...}`).
Expand All @@ -25,7 +25,7 @@ selectors (e.g. `.sbb-list { @include sbb.list; }` > `.sbb-list:where(ol, ul) {.

## sbb-step-list

| CSS class | SASS mixin |
| CSS class | Sass mixin |
| --------------- | ----------- |
| `sbb-step-list` | `step-list` |

Expand All @@ -41,7 +41,7 @@ by using the predefined classes (e.g. `sbb-text-s`).

## sbb-icon-list

| CSS class | SASS mixin |
| CSS class | Sass mixin |
| --------------- | ----------- |
| `sbb-icon-list` | `icon-list` |

Expand Down Expand Up @@ -95,7 +95,7 @@ than the text, the CSS variable `--sbb-icon-list-marker-icon-color` can be used.

## sbb-description-list

| CSS class | SASS mixin |
| CSS class | Sass mixin |
| ---------- | ------------------ |
| `sbb-list` | `description-list` |

Expand All @@ -104,7 +104,7 @@ The description list doesn't define any color itself but inherits it.

### Sass usage

The SASS mixin can be included at top level or in a rule.
The Sass mixin can be included at top level or in a rule.
If used at top level it will apply rules to the native `<dl>` element.
If used inside a rule it will extend the rule with `<dl>`.
selectors (e.g. `.sbb-list { @include sbb.description-list; }` > `.sbb-list:where(dl) {...}`).
Expand Down
6 changes: 3 additions & 3 deletions src/storybook/styles/scrollbar/readme.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## Scrollbar

The scrollbar SASS mixin and CSS classes offer a combination of size, color and whether the track is visible or not.
The scrollbar Sass mixin and CSS classes offer a combination of size, color and whether the track is visible or not.

In Firefox the styles are looking differently as there are no possibilities to style the scrollbar exactly as designed.

| CSS class | SASS mixin |
| CSS class | Sass mixin |
| -------------------------------------------- | ------------------------------------------------------------------ |
| `sbb-scrollbar` | `scrollbar($size: thin, $negative: false, $track-visible: false)` |
| `sbb-scrollbar-negative` | `scrollbar($size: thin, $negative: true, $track-visible: false)` |
Expand All @@ -15,7 +15,7 @@ In Firefox the styles are looking differently as there are no possibilities to s
| `sbb-scrollbar-thick-track-visible` | `scrollbar($size: thick, $negative: false, $track-visible: true)` |
| `sbb-scrollbar-thick-negative-track-visible` | `scrollbar($size: thick, $negative: true, $track-visible: true)` |

** Possible values of SASS mixin **
** Possible values of Sass mixin **

- `$size` thin or thick
- `$negative` true or false
Expand Down
2 changes: 1 addition & 1 deletion src/storybook/styles/table/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ This scheme changes the text color of the cells to `sbb-color-iron`.
In advanced scenarios, predefined classes might not suffice.
Therefore, we provide mixins you can build on top of:

| SASS Mixin | CSS class | Description |
| Sass Mixin | CSS class | Description |
| -------------------- | ------------------------ | ----------------------------------------- |
| `table` | `sbb-table` | The table style (equivalent to `table-m`) |
| `table--m` | `sbb-table-m` | Medium size table style |
Expand Down
10 changes: 5 additions & 5 deletions src/storybook/styles/typography/readme.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
## Text styles

Every text size (xxs, xs, s, m, l and xl) is available as SASS mixin or CSS class.
Every text size (xxs, xs, s, m, l and xl) is available as Sass mixin or CSS class.
It also includes line-height, letter-spacing and font-family.

The native browser margins (1em) between paragraph elements `<p>` correctly corresponds
to the defined paragraph spacing. Due to this there are no additional rules for paragraph spacing.

| CSS class | CSS class bold | SASS mixin | SASS mixin bold |
| CSS class | CSS class bold | Sass mixin | Sass mixin bold |
| -------------- | ----------------------------- | ------------------- | ---------------- |
| `sbb-text-xxs` | `sbb-text-xxs sbb-text--bold` | `text-xxs--regular` | `text-xxs--bold` |
| `sbb-text-xs` | `sbb-text-xs sbb-text--bold` | `text-xs--regular` | `text-xs--bold` |
Expand All @@ -23,22 +23,22 @@ to the defined paragraph spacing. Due to this there are no additional rules for

## Legend

| CSS class | SASS mixin |
| CSS class | Sass mixin |
| ------------ | ---------- |
| `sbb-legend` | `legend` |

## Sub

The `<sub>`-tag is also overridden globally as long as you include our global styles.

| SASS mixin |
| Sass mixin |
| ---------- |
| `sub` |

## Sup

The `<sup>`-tag is also overridden globally as long as you include our global styles.

| SASS mixin |
| Sass mixin |
| ---------- |
| `sup` |

0 comments on commit d913e05

Please sign in to comment.