Filter theme keys.
parent
4afdd15813
commit
156aee4aba
|
|
@ -101,10 +101,12 @@ export const PRESETS: { [key: string]: Theme } = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const keys = Object.keys(PRESETS.dark);
|
||||||
const GlobalTheme = createGlobalStyle<{ theme: Theme }>`
|
const GlobalTheme = createGlobalStyle<{ theme: Theme }>`
|
||||||
:root {
|
:root {
|
||||||
${(props) =>
|
${(props) =>
|
||||||
(Object.keys(props.theme) as Variables[]).map((key) => {
|
(Object.keys(props.theme) as Variables[]).map((key) => {
|
||||||
|
if (!keys.includes(key)) return;
|
||||||
return `--${key}: ${props.theme[key]};`;
|
return `--${key}: ${props.theme[key]};`;
|
||||||
})}
|
})}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue