nx: fix dark recognition

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/672/head
Varun Patil 2023-05-18 19:18:04 -07:00
parent 85bb2fdd9b
commit 1b1f32e623
1 changed files with 1 additions and 1 deletions

View File

@ -55,7 +55,7 @@ export async function setTheme(color?: string, dark?: boolean) {
color ??= getComputedStyle(document.body).getPropertyValue('--color-main-background');
dark ??=
window.matchMedia('(prefers-color-scheme: dark)').matches ||
(document.body.hasAttribute('data-theme-default') && window.matchMedia('(prefers-color-scheme: dark)').matches) ||
document.body.hasAttribute('data-theme-dark') ||
document.body.hasAttribute('data-theme-dark-highcontrast');
nativex?.setThemeColor?.(color, dark);