expose dark class on html

This commit is contained in:
tophf 2022-02-15 23:07:17 +03:00
parent 69a421744d
commit 6dc87d2a31

View File

@ -1,3 +1,4 @@
/* global $ */// dom.js
/* global API msg */// msg.js
'use strict';
@ -20,6 +21,7 @@ API.colorScheme.shouldIncludeStyle('darkUI').then(val => {
}
});
function toggleDarkStyles() {
$.root.dataset.uiTheme = isDark ? 'dark' : 'light';
for (const sheet of document.styleSheets) {
for (const {media: m} of sheet.cssRules) {
if (m && m[1] === 'dark' && (m[0] === 'screen') !== isDark) {