Fix isDarkMode utility (#37470)
This commit is contained in:
parent
be60c4585e
commit
41639655ff
@ -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