Skip to content

Commit

Permalink
feat: increase the specificity of the wpds-dark selector to ensure it…
Browse files Browse the repository at this point in the history
… overrides light variables
  • Loading branch information
wp-aberg committed Mar 25, 2024
1 parent 2640be2 commit fd7748f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ node_modules
out
jest-coverage
plop-templates
/ui/theme/src/tokens.ts
ui/theme/src/tokens.ts
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"extends": "./tsconfig.base.json",
"exclude": ["./ui/theme/src/tokens.ts"],
"compilerOptions": {
"baseUrl": ".",
"paths": {
Expand Down
9 changes: 8 additions & 1 deletion ui/theme/src/stitches.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,21 @@ export const {
} = WPDS;
export const utils = config.utils;

export const darkTheme = createTheme(`${prefix}-dark`, {
const _darkTheme = createTheme(`${prefix}-dark.${prefix}-dark`, {
colors: {
...tokens.dark,
...tokens.staticColors,
...tokens.darkTheme,
},
});

export const darkTheme = {
className: `${prefix}-dark`,
selector: _darkTheme.selector,
colors: _darkTheme.colors,
toString: () => `${prefix}-dark`,
};

export const globalStyles = globalCss({
":root": {
"--base": `${tokens.base}`,
Expand Down

0 comments on commit fd7748f

Please sign in to comment.