From d913e053d4e8ca73cf5af2613075d1823eb660e0 Mon Sep 17 00:00:00 2001 From: Jeremias Peier Date: Thu, 12 Dec 2024 08:52:54 +0100 Subject: [PATCH 1/2] docs: standardize Sass term writing --- docs/CODING_STANDARDS.md | 6 +++--- docs/CONTRIBUTING.md | 2 +- docs/DEVELOPER.md | 2 +- docs/GETTING_STARTED.md | 10 +++++----- src/elements/notification/notification.scss | 2 +- src/storybook/styles/layout/readme.md | 6 +++--- src/storybook/styles/list/readme.md | 12 ++++++------ src/storybook/styles/scrollbar/readme.md | 6 +++--- src/storybook/styles/table/readme.md | 2 +- src/storybook/styles/typography/readme.md | 10 +++++----- 10 files changed, 29 insertions(+), 29 deletions(-) diff --git a/docs/CODING_STANDARDS.md b/docs/CODING_STANDARDS.md index 6db87fc474..d80d344ddf 100644 --- a/docs/CODING_STANDARDS.md +++ b/docs/CODING_STANDARDS.md @@ -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. @@ -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`). @@ -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: diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index aa8d279882..1bc6f51691 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -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 diff --git a/docs/DEVELOPER.md b/docs/DEVELOPER.md index 98faa16c46..4c8939b186 100644 --- a/docs/DEVELOPER.md +++ b/docs/DEVELOPER.md @@ -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 diff --git a/docs/GETTING_STARTED.md b/docs/GETTING_STARTED.md index 1c8a0b3390..41e5427d92 100644 --- a/docs/GETTING_STARTED.md +++ b/docs/GETTING_STARTED.md @@ -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; @@ -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; @@ -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 diff --git a/src/elements/notification/notification.scss b/src/elements/notification/notification.scss index 0d5fb6c14d..bfe101c2c1 100644 --- a/src/elements/notification/notification.scss +++ b/src/elements/notification/notification.scss @@ -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 diff --git a/src/storybook/styles/layout/readme.md b/src/storybook/styles/layout/readme.md index 4c82685cb3..922cdeac2a 100644 --- a/src/storybook/styles/layout/readme.md +++ b/src/storybook/styles/layout/readme.md @@ -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` | @@ -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` | diff --git a/src/storybook/styles/list/readme.md b/src/storybook/styles/list/readme.md index be7084f9fc..69595711f6 100644 --- a/src/storybook/styles/list/readme.md +++ b/src/storybook/styles/list/readme.md @@ -1,6 +1,6 @@ ## sbb-list -| CSS class | SASS mixin | +| CSS class | Sass mixin | | ---------- | ---------- | | `sbb-list` | `list` | @@ -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 `