Skip to content
Snippets Groups Projects
Commit 82b8a9b2 authored by insert's avatar insert
Browse files

Filter theme keys.

parent 209653df
Branches
No related merge requests found
......@@ -101,10 +101,12 @@ export const PRESETS: { [key: string]: Theme } = {
},
};
const keys = Object.keys(PRESETS.dark);
const GlobalTheme = createGlobalStyle<{ theme: Theme }>`
:root {
${(props) =>
(Object.keys(props.theme) as Variables[]).map((key) => {
if (!keys.includes(key)) return;
return `--${key}: ${props.theme[key]};`;
})}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment