W3C home > Mailing lists > Public > public-css-archive@w3.org > April 2019

Re: [csswg-drafts] [css-ui] Add a way for authors to indicate that they want dark-mode form controls etc (#3299)

From: Thomas Steiner via GitHub <sysbot+gh@w3.org>
Date: Wed, 03 Apr 2019 07:56:05 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-479380882-1554278164-sysbot+gh@w3.org>
I think what this meta tag does gets pretty clear at the example of [WebKit's user-agent stylesheet](https://trac.webkit.org/browser/trunk/Source/WebCore/css/html.css) (do a full text search for "dark").

To illustrate, here's one such CSS rule (using the [`:matches`](https://css-tricks.com/almanac/selectors/m/matches/) pseudo class and WebKit-internal variables like `-apple-system-control-background` as well as WebKit-internal preprocessor directives):

```css
input,
input:matches([type="password"], [type="search"]) {
  -webkit-appearance: textfield;
  #if defined(HAVE_OS_DARK_MODE_SUPPORT) && HAVE_OS_DARK_MODE_SUPPORT
    color: text;
    background-color: -apple-system-control-background;
  #else
    background-color: white;
  #endif
  […]
}
```



-- 
GitHub Notification of comment by tomayac
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3299#issuecomment-479380882 using your GitHub account
Received on Wednesday, 3 April 2019 07:56:06 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:31:06 UTC