ソースを参照

fixed dark teheme detection

Former-commit-id: eccfbf1452c3b9851df8aa75e95524bd79e27d52
Gildas 5 年 前
コミット
fa525fecf2
1 ファイル変更2 行追加1 行削除
  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");