nx: fix dark recognition
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/672/head
parent
85bb2fdd9b
commit
1b1f32e623
|
@ -55,7 +55,7 @@ export async function setTheme(color?: string, dark?: boolean) {
|
||||||
|
|
||||||
color ??= getComputedStyle(document.body).getPropertyValue('--color-main-background');
|
color ??= getComputedStyle(document.body).getPropertyValue('--color-main-background');
|
||||||
dark ??=
|
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') ||
|
||||||
document.body.hasAttribute('data-theme-dark-highcontrast');
|
document.body.hasAttribute('data-theme-dark-highcontrast');
|
||||||
nativex?.setThemeColor?.(color, dark);
|
nativex?.setThemeColor?.(color, dark);
|
||||||
|
|
Loading…
Reference in New Issue