Refactor and fix

This commit is contained in:
schmelczerandras 2020-11-22 22:43:28 +01:00
parent 91d92f7f48
commit 4be519f052
22 changed files with 118 additions and 113 deletions

View file

@ -2,7 +2,7 @@ export const isSystemLevelDarkModeEnabled = (): boolean =>
matchMedia && matchMedia('(prefers-color-scheme: dark)').matches;
export const turnOnDarkMode = () =>
document.body.parentElement.setAttribute('theme', 'dark');
document.documentElement.setAttribute('theme', 'dark');
export const turnOnLightMode = () =>
document.body.parentElement.setAttribute('theme', 'light');
document.documentElement.setAttribute('theme', 'light');