diff --git a/docs/GETTING_STARTED.md b/docs/GETTING_STARTED.md index 50c602ae87..9da5454934 100644 --- a/docs/GETTING_STARTED.md +++ b/docs/GETTING_STARTED.md @@ -211,6 +211,8 @@ However, if you like to more specifically pick what you need, consider the follo | `animation.css` | Provides CSS classes to disable animation (e.g. for testing). | | `layout.css` | Provides layout related CSS classes (e.g. page spacing, grid). | | `lists.css` | Provides CSS classes to style lists. | +| `scrollbar.css` | Provides CSS classes to style a scrollbar. | +| `table.css` | Provides CSS classes to style a table. | | `typography.css` | Provides typography related CSS classes. | ### Full Font diff --git a/src/elements/core/styles/scrollbar.scss b/src/elements/core/styles/scrollbar.scss new file mode 100644 index 0000000000..b25fd11c0b --- /dev/null +++ b/src/elements/core/styles/scrollbar.scss @@ -0,0 +1,44 @@ +@use './mixins/scrollbar'; + +.sbb-scrollbar, +.sbb-scrollbar-negative, +.sbb-scrollbar-thick, +.sbb-scrollbar-thick-negative, +.sbb-scrollbar-track-visible, +.sbb-scrollbar-negative-track-visible, +.sbb-scrollbar-thick-track-visible, +.sbb-scrollbar-thick-negative-track-visible { + @include scrollbar.scrollbar-rules; +} + +.sbb-scrollbar { + @include scrollbar.scrollbar-variables($size: thin, $negative: false, $track-visible: false); +} + +.sbb-scrollbar-negative { + @include scrollbar.scrollbar-variables($size: thin, $negative: true, $track-visible: false); +} + +.sbb-scrollbar-thick { + @include scrollbar.scrollbar-variables($size: thick, $negative: false, $track-visible: false); +} + +.sbb-scrollbar-thick-negative { + @include scrollbar.scrollbar-variables($size: thick, $negative: true, $track-visible: false); +} + +.sbb-scrollbar-track-visible { + @include scrollbar.scrollbar-variables($size: thin, $negative: false, $track-visible: true); +} + +.sbb-scrollbar-negative-track-visible { + @include scrollbar.scrollbar-variables($size: thin, $negative: true, $track-visible: true); +} + +.sbb-scrollbar-thick-track-visible { + @include scrollbar.scrollbar-variables($size: thick, $negative: false, $track-visible: true); +} + +.sbb-scrollbar-thick-negative-track-visible { + @include scrollbar.scrollbar-variables($size: thick, $negative: true, $track-visible: true); +} diff --git a/src/elements/core/styles/standard-theme.scss b/src/elements/core/styles/standard-theme.scss index 984efe558b..569ce30a4d 100644 --- a/src/elements/core/styles/standard-theme.scss +++ b/src/elements/core/styles/standard-theme.scss @@ -7,4 +7,5 @@ @use './animation'; @use './layout'; @use './lists'; +@use './scrollbar'; @use './table'; diff --git a/src/elements/vite.config.ts b/src/elements/vite.config.ts index 448d153783..eea633f2f5 100644 --- a/src/elements/vite.config.ts +++ b/src/elements/vite.config.ts @@ -63,10 +63,12 @@ export default defineConfig((config) => 'animation.css', 'core.css', 'font-characters-extension.css', - 'standard-theme.css', 'layout.css', 'lists.css', 'normalize.css', + 'scrollbar.css', + 'standard-theme.css', + 'table.css', 'typography.css', ]), }, diff --git a/src/storybook/styles/layout/readme.md b/src/storybook/styles/layout/readme.md index 1d85c25dd9..4c82685cb3 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) +[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 9db25d7668..be7084f9fc 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 `
` 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` | @@ -23,7 +23,7 @@ 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` | @@ -31,7 +31,7 @@ to the defined paragraph spacing. Due to this there are no additional rules for The ``-tag is also overridden globally as long as you include our global styles. -| sass mixin | +| SASS mixin | | ---------- | | `sub` | @@ -39,6 +39,6 @@ The ``-tag is also overridden globally as long as you include our global st The ``-tag is also overridden globally as long as you include our global styles. -| sass mixin | +| SASS mixin | | ---------- | | `sup` | diff --git a/tools/vite/typography.ts b/tools/vite/typography.ts index 031db40711..a2d15b7633 100644 --- a/tools/vite/typography.ts +++ b/tools/vite/typography.ts @@ -24,7 +24,9 @@ export function typography(): PluginOption { { inputName: 'core/styles/layout.scss', outputName: 'layout.css' }, { inputName: 'core/styles/lists.scss', outputName: 'lists.css' }, { inputName: 'core/styles/normalize.scss', outputName: 'normalize.css' }, + { inputName: 'core/styles/scrollbar.scss', outputName: 'scrollbar.css' }, { inputName: 'core/styles/standard-theme.scss', outputName: 'standard-theme.css' }, + { inputName: 'core/styles/table.scss', outputName: 'table.css' }, { inputName: 'core/styles/typography.scss', outputName: 'typography.css' }, ].forEach((entry) => { const compiled = sass.compile(join(viteConfig.root, entry.inputName), {