summaryrefslogtreecommitdiff
path: root/modules/libpref/init/all.js
diff options
context:
space:
mode:
authorathenian200 <athenian200@outlook.com>2021-03-23 02:14:40 -0500
committerathenian200 <athenian200@outlook.com>2021-03-23 22:25:54 -0500
commit42c751ed8773defbba77dd234abb0d5d5db94341 (patch)
treeaff4c2f37a80c6f4c79e32df564bb18a31172536 /modules/libpref/init/all.js
parent0dbcd15ec9fbfdce09b9bf2e7ae89515696275ea (diff)
downloaduxp-42c751ed8773defbba77dd234abb0d5d5db94341.tar.gz
Issue mcp-graveyard/UXP#1752 - Implement "prefers-color-scheme" as a user preference.
This PR passes all current tests for this feature, and implements the "prefers-color-scheme" media query as an enumerated keyword that is controlled by an integer preference. Currently, the possible options are 0 to see a website's fallback code and essentially behave like this isn't implemented (our current behavior), 1 to express a preference for a light theme (the default for spec reasons), and 2 to express a preference for a dark theme. Over time, this list may expand to include other preferences like a preference for a sepia theme or something, and this leaves us prepared for that future.
Diffstat (limited to 'modules/libpref/init/all.js')
-rw-r--r--modules/libpref/init/all.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js
index 993eef3914..a24bec7a5a 100644
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -266,6 +266,10 @@ pref("browser.display.use_document_fonts", 1); // 0 = never, 1 = quick, 2 = al
// 1 = always
// 2 = never
pref("browser.display.document_color_use", 0);
+// 0 = feature disabled
+// 1 = default: light theme preferred
+// 2 = dark theme preferred
+pref("browser.display.prefers_color_scheme", 1);
pref("browser.display.use_system_colors", false);
pref("browser.display.foreground_color", "#000000");
pref("browser.display.background_color", "#FFFFFF");