Explorar o código

added support of dark theme in readability mode

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

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

@@ -21,7 +21,7 @@
  *   Source.
  */
 
-/* global singlefile, window, document, fetch, DOMParser, getComputedStyle, setTimeout, clearTimeout, NodeFilter, Readability, isProbablyReaderable */
+/* global singlefile, window, document, fetch, DOMParser, getComputedStyle, setTimeout, clearTimeout, NodeFilter, Readability, isProbablyReaderable, matchMedia */
 
 (async () => {
 
@@ -893,6 +893,9 @@ table {
 			document.body.classList.add("sans-serif");
 			document.body.classList.add("container");
 			document.body.classList.add("line-height4");
+			if (matchMedia("prefers-color-scheme: dark")) {
+				document.body.classList.add("dark");
+			}
 			document.body.style.setProperty("display", "block");
 			document.body.style.setProperty("padding", "24px");
 			const titleElement = document.createElement("h1");