Skip to content

Commit 39d8fa1

Browse files
committed
Fixes dark theme replace bug
1 parent 5c0a72d commit 39d8fa1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/styles/themes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ const buildCssVariables = <T>(variables: ThemeVariables) => {
148148
const keys = Object.keys(variables) as (keyof ThemeVariables)[];
149149
return keys.reduce(
150150
(acc, key) =>
151-
acc.concat(`--${key.replace(/_/, '-')}: ${variables[key]};`, '\n'),
151+
acc.concat(`--${key.replace(/_/g, '-')}: ${variables[key]};`, '\n'),
152152
'',
153153
);
154154
};
@@ -158,7 +158,7 @@ export const themes = {
158158
dark: buildCssVariables(themeVariableSets.dark),
159159
};
160160

161-
const cssVar = (name: string) => `var(--${name.replace(/_/, '-')})`;
161+
const cssVar = (name: string) => `var(--${name.replace(/_/g, '-')})`;
162162

163163
const variableKeys = Object.keys(themeVariableSets.light) as VariableKey[];
164164

0 commit comments

Comments
 (0)