[Glitch] Fix isDarkMode utility

Port 41639655ffaa9914632fe937c9583b901b36f5cc to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
diondiondion 2026-01-13 12:06:54 +01:00 committed by Claire
parent e14af55640
commit beb23500b1

View File

@ -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';
}