fix light mode in dark system

This commit is contained in:
tophf 2022-02-18 04:35:36 +03:00
parent 9fbf641571
commit 77562ecd8d

View File

@ -24,7 +24,7 @@ API.colorScheme.shouldIncludeStyle('darkUI').then(val => {
$.root.dataset.uiTheme = isDark ? 'dark' : 'light'; $.root.dataset.uiTheme = isDark ? 'dark' : 'light';
for (const sheet of document.styleSheets) { for (const sheet of document.styleSheets) {
for (const {media: m} of sheet.cssRules) { for (const {media: m} of sheet.cssRules) {
if (m && m[1] === 'dark' && (m[0] === 'screen') !== isDark) { if (m && m[1] === 'dark' && /screen/.test(m[0]) !== isDark) {
m.mediaText = isDark ? 'screen,dark' : 'not all,dark'; m.mediaText = isDark ? 'screen,dark' : 'not all,dark';
} }
} }