Add dark mode

This commit is contained in:
Schmelczer András 2020-01-07 21:30:23 +01:00
parent 48a55a4a97
commit 073f087e52
40 changed files with 864 additions and 531 deletions

View file

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