mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-22 07:00:58 -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 }>`
|
||||
:root {
|
||||
${(props) =>
|
||||
(Object.keys(props.theme) as Variables[]).map((key) => {
|
||||
if (!keys.includes(key)) return;
|
||||
return `--${key}: ${props.theme[key]};`;
|
||||
})}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue