[Glitch] Fix isDarkMode utility
Port 41639655ffaa9914632fe937c9583b901b36f5cc to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
e14af55640
commit
beb23500b1
@ -5,9 +5,7 @@ export function getUserTheme() {
|
||||
|
||||
export function isDarkMode() {
|
||||
const { userTheme } = document.documentElement.dataset;
|
||||
return (
|
||||
(userTheme === 'system' &&
|
||||
window.matchMedia('(prefers-color-scheme: dark)').matches) ||
|
||||
userTheme !== 'mastodon-light'
|
||||
);
|
||||
return userTheme === 'system'
|
||||
? window.matchMedia('(prefers-color-scheme: dark)').matches
|
||||
: userTheme !== 'mastodon-light';
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user