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 <input type=range> 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
This commit is contained in:
Emilio Cobos Álvarez 2023-05-27 16:09:29 +02:00 committed by Oriol Brufau
parent b6fa162955
commit 5766329ffe

View file

@ -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.