git.lucas.co / cce-system-interface
system settings
git clone https://git.lucas.co/cce-system-interface.git

commit590822d7ae059fbaf290b9dfe3e774608a051810
parent8759098e2d
authorLucas Galante <[email protected]>
date2026-08-24 13:09
feat: a Force Dark choice on the Page Color Scheme menu

Third option alongside Dark and Light, writing browser.color-scheme
"force-dark". The browser then also installs an inverting user stylesheet,
which darkens sites that ship no dark theme at all — at the cost of
fighting their palette, so it reads as the deliberate last resort it is.

Co-Authored-By: Claude Opus 5 <[email protected]>

 src/pages/browser.rs | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/pages/browser.rs b/src/pages/browser.rs
index f84c66e..233aad3 100644
--- a/src/pages/browser.rs
+++ b/src/pages/browser.rs
@@ -26,9 +26,12 @@ pub const SEARCH_ENGINES: [(&str, &str); 4] = [
 /// navigation bar is anchored to.
 pub const BAR_POSITIONS: [(&str, &str); 2] = [("top", "Top"), ("bottom", "Bottom")];
 
-/// config key, menu label — reported to pages as `prefers-color-scheme`,
-/// so sites that ship a dark stylesheet use it.
-pub const COLOR_SCHEMES: [(&str, &str); 2] = [("dark", "Dark"), ("light", "Light")];
+/// config key, menu label — the first two are reported to pages as
+/// `prefers-color-scheme`, so sites that ship a dark stylesheet use it.
+/// "Force Dark" additionally inverts the page, for sites that ship no dark
+/// theme; it fights their palette, so it is a deliberate last resort.
+pub const COLOR_SCHEMES: [(&str, &str); 3] =
+    [("dark", "Dark"), ("light", "Light"), ("force-dark", "Force Dark")];
 
 const DEFAULT_HOMEPAGE: &str = "https://servo.org";