From 5766329ffe2eb93ccf8c178c3fa381adcedc057c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 27 May 2023 16:09:29 +0200 Subject: [PATCH] style: Add basic support for dark form controls to nsNativeBasicTheme For that: * Tweak the standin system colors to match the non-native theme. * Use those system colors for button and field backgrounds. * Rename the "should use system colors" bit to "is high contrast", which is what it really is (specially now that we use system colors also in non-high-contrast). Border colors and other colors like the and such might need some extra tweaking perhaps, but this is a decent start and looks good in https://crisal.io/tmp/form-controls.html afaict (dark mode toggle needs the color-scheme pref enabled of course). Differential Revision: https://phabricator.services.mozilla.com/D127533 --- components/style/values/specified/color.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/style/values/specified/color.rs b/components/style/values/specified/color.rs index 6de2464d470..c5288cb1f6b 100644 --- a/components/style/values/specified/color.rs +++ b/components/style/values/specified/color.rs @@ -316,8 +316,12 @@ pub enum SystemColor { Captiontext, #[parse(aliases = "-moz-field")] Field, + /// Used for disabled field backgrounds. + #[parse(condition = "ParserContext::in_ua_or_chrome_sheet")] + MozDisabledfield, #[parse(aliases = "-moz-fieldtext")] Fieldtext, + Graytext, Highlight, Highlighttext, @@ -382,6 +386,10 @@ pub enum SystemColor { #[parse(condition = "ParserContext::in_ua_or_chrome_sheet")] MozButtonactiveface, + /// Used for button background when disabled. + #[parse(condition = "ParserContext::in_ua_or_chrome_sheet")] + MozButtondisabledface, + /// Background color of chrome toolbars in active windows. MozMacChromeActive, /// Background color of chrome toolbars in inactive windows.