mirror of
https://github.com/mastodon/mastodon.git
synced 2026-08-14 15:46:38 -05:00
Fix isDarkMode utility (#37470)
This commit is contained in:
@@ -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';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user