mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-29 10:20:59 -05:00
Filter theme keys.
This commit is contained in:
parent
209653dfd7
commit
82b8a9b28e
1 changed files with 2 additions and 0 deletions
|
@ -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 a new issue