Skip to content

Commit

Permalink
feat: set color and background on :root and color modes (#2544)
Browse files Browse the repository at this point in the history
I created a new baseline file, as it seems like our `ds-reset` file will
be removed soon.
I am importing the new file under the layer `ds.baseline`, but this
could also be imported in `ds.reset`

part of #2454
  • Loading branch information
Barsnes authored Oct 1, 2024
1 parent 791dabc commit f08ec98
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion apps/storybook/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ export const decorators = [
},
defaultTheme: 'Light',
attributeName: 'data-ds-color-mode',
parentSelector: '.sbdocs, .sb-main-padded',
parentSelector:
'.sbdocs-preview .docs-story div:first-of-type, .sb-show-main:has(#storybook-docs[hidden="true"])',
}),
];

Expand Down
5 changes: 5 additions & 0 deletions packages/css/baseline/baseline.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:root,
[data-ds-color-mode] {
color: var(--ds-color-neutral-text-default);
background-color: var(--ds-color-neutral-background-default);
}
3 changes: 2 additions & 1 deletion packages/css/index.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
@charset "UTF-8";

@layer ds.reset, ds.theme, ds.base, ds.components;
@layer ds.reset, ds.baseline, ds.theme, ds.base, ds.components;

/** Import order defines ordinal specificity for layers */
@import url('./baseline/ds-reset.css') layer(ds.reset);
@import url('./baseline/baseline.css') layer(ds.baseline);
@import url('./baseline/typography.css') layer(ds.base.typography);
@import url('./utilities.css') layer(ds.base.utilities);
@import url('./button.css') layer(ds.components);
Expand Down

0 comments on commit f08ec98

Please sign in to comment.