Re: [csswg-drafts] [css-color-adjust-1] more granular overriding of forced colors mode than per-element (#4178)

Summary of the discussion is that dbaron argued that we've historically considered "property A which influences how property B works" as a bad idea; a notable example is 'box-sizing' which is generally considered a legacy mistake. Several people agreed with this.

Instead, some sort of addition to the value space of the properties was preferred. I suggested that we finally use the ! space that Syntax allows, as it gives us an unambiguous way to add to flags to values without worrying about syntax collisions; this would look something like `color: blue !override-forced-color;`.  (Post-call correction: I actually simplified Syntax to *just* look for !important at some point, and not have a general mechanism. But it's still totally possible to re-open that with some trivial fixes.) This wouldn't conflict with the existing !important; you should still be able to say `color: blue !important override-forced-color;` if you wanted to.

This received general approval, but there was a split in how it should be interpreted. The broadly accepted possibilities were:

1. The !-ident would kick the declaration into a mega-important cascade origin, overriding the UA-important origin that the forced-colors declarations live in. (This means that in `.foo { color: red !override-forced-color; } #bar { color: blue; }`, the red would win in all cases over the blue, despite blue having a higher specificity.)

2. The forced-colors-mode declarations, rather than living in a high origin, instead magically override the cascade winner. If the cascade winner has the !-ident, it doesn't get overridden. (So in the above example, the blue would win the cascade as normal, and then get overridden by a forced color.)

3. Like 1, but the declaration gets moved into the special origin *only* if forced colors are active. (So blue would win normally, but red would win if forced-colors-mode was active.)

Rossen didn't want to discard (3), but Florian and I didn't like it, because it would mean a significant behavior change in forced-colors-mode that is likely to not really be tested.

-----

Also, given <https://github.com/w3c/csswg-drafts/issues/4175#issuecomment-603965581>, forced colors mode **can't** be just literally applying rules in a high origin based on a MQ. It's gonna have to do something magical for at least *some* properties, to preserve the alpha component of the author's cascade-winning color, so it doesn't feel like there's much value in preserving the fiction that it's just a line in the UA sheet; instead I think we should go whole-hog in the "it's a magical adjustment" direction.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4178#issuecomment-607555662 using your GitHub account

Received on Thursday, 2 April 2020 00:31:28 UTC