mirror of https://github.com/Facinorous-420/dick
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
292 B
9 lines
292 B
2 years ago
|
if (
|
||
|
localStorage.getItem('color-theme') === 'dark' ||
|
||
|
(!('color-theme' in localStorage) &&
|
||
|
window.matchMedia('(prefers-color-scheme: dark)').matches)
|
||
|
) {
|
||
|
document.documentElement.classList.add('dark');
|
||
|
} else {
|
||
|
document.documentElement.classList.remove('dark');
|
||
|
}
|