Explorar o código

fixed dark teheme detection

Former-commit-id: eccfbf1452c3b9851df8aa75e95524bd79e27d52
Gildas %!s(int64=5) %!d(string=hai) anos
pai
achega
fa525fecf2
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      extension/ui/content/content-ui-editor-web.js

+ 2 - 1
extension/ui/content/content-ui-editor-web.js

@@ -1348,7 +1348,8 @@ table {
 		document.body.classList.add("sans-serif");
 		document.body.classList.add("container");
 		document.body.classList.add("line-height4");
-		if (applySystemTheme && matchMedia("prefers-color-scheme: dark")) {
+		const prefersColorSchemeDark = matchMedia("(prefers-color-scheme: dark)");
+		if (applySystemTheme && prefersColorSchemeDark && prefersColorSchemeDark.matches) {
 			document.body.classList.add("dark");
 		}
 		document.body.style.setProperty("display", "block");