mirror of
https://github.com/mastodon/mastodon.git
synced 2026-04-24 23:29:30 -05:00
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…
Reference in New Issue
Block a user