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

Re: [csswg-drafts] [mediaqueries-5] Remove or expand inverted-colors (#3858)

From: Amelia Bellamy-Royds via GitHub <sysbot+gh@w3.org>
Date: Sat, 20 Apr 2019 22:35:37 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-485187359-1555799736-sysbot+gh@w3.org>
Copying over my comments from https://github.com/w3c/csswg-drafts/issues/3807#issuecomment-480447849:

I wonder if `inverted-colors` could be generalized as `forced-filter`, to also include "night light" effects that change the brightness and hue of the screen.  e.g. `@media (forced-filter: invert)` vs `@media (forced-filter: sepia)` or just `@media (forced-filter)` to indicate that the user agent or OS is filtering the final rendered colors.

That would also avoid any confusion about how invert mode interacts with individual color values — it's a filter effect that applies to the full screen, although it is possible to revert the effect with opposite filters on individual elements. (I _think_ this is how the Safari implementation works, with the "reverting invert" filters on images and videos now specified in the user style sheet.  So specifying the same rule in an author stylesheet would have neither harm nor benefit.  But someone who is familiar with the latest WebKit changes needs to confirm.)

The special cascade order rules for `forced-color` / `-ms-high-contrast` might also apply for `forced-filter` and other “forced” UA media manipulations. Whether this is necessary would depend on how many other user-agent style tweaks get added in those conditions.  But for example, maybe I have an `<img>` that is a black line drawing on a white background and it _should_ actually get inverted to white on black when the user has inverted the rest of the screen, so I want to use `img { filter: none}` to cancel out any user-agent stylesheet that double-inverts images.

(Note, that last comment is less relevant if forced-color overrides are done using revert instead of cascade trickery.)



-- 
GitHub Notification of comment by AmeliaBR
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3858#issuecomment-485187359 using your GitHub account
Received on Saturday, 20 April 2019 22:35:40 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:46 UTC