Re: [csswg-drafts] [css-color] [css-ui-4] Authors should have access to accent-color value to use in their code (#5900)

The CSS Working Group just discussed `[css-color] [css-ui-4] Authors should have access to accent-color value to use in their code`, and agreed to the following:

* `RESOLVED: AccentColor takes its value from accent-color, and AccentColorText takes its value from the appropriately contrasting foreground color for AccentColor; these resolve at computed value time`

<details><summary>The full IRC log of that discussion</summary>
&lt;emilio> florian: no longer objecting<br>
&lt;fantasai> emilio: to restate, this was about making AccentColor and AccentColorText react to accent-color property<br>
&lt;fantasai> emilio: some concern about them resolving at computed value time making it harder to not expose the system color from OS<br>
&lt;fantasai> emilio: but as Florian said, no longer objecting on that basis<br>
&lt;fantasai> emilio: I think general consensus was, make these react to accent-color property<br>
&lt;fantasai> emilio: figure out a reasonable definition for what happens with color/currentColor/accent-color/AccentColor cycles<br>
&lt;fantasai> emilio: That's TBD, can sort out in a separate issue<br>
&lt;fantasai> emilio: I think we were working towards resolving like other system colors at computed value time<br>
&lt;fantasai> emilio: it's easier implementation-wise, and more sense if accent-color changes throughout the tree<br>
&lt;emilio> fantasai: not sure about the resolving about the resolving at computed-value time<br>
&lt;emilio> ... currentcolor doesn't do that<br>
&lt;emilio> ... sympathetic to the impl complexity argument<br>
&lt;fantasai> emilio: I have a counter-example<br>
&lt;fantasai> emilio: all system colors go in pairs, right? Not talking about one keyword, but two<br>
&lt;fantasai> emilio: all system colors that go in pairs resolve early<br>
&lt;fantasai> emilio: changing the color could cause text to be unreadable<br>
&lt;fantasai> emilio: consider you have :root... { background: AccentColor; color: accentColorText; }<br>
&lt;fantasai> emilio: if you change the accent-color further down in the tree, then you can end up with text you can't read<br>
&lt;miriam> q+<br>
&lt;emilio> fantasai: but that's the behavior of color: currentColor and such right?<br>
&lt;emilio> emilio: but color is only one, there's no background / foreground concept<br>
&lt;emilio> fantasai: right, but...<br>
&lt;emilio> miriam: several questions<br>
&lt;fantasai> fantasai: if you set a color that works on a background, and then change it down the tree you can get unreadable text also<br>
&lt;fantasai> fantasai: so don't do that; same thing here.<br>
&lt;emilio> miriam: maybe I wasn't following<br>
&lt;emilio> ... do these get set once at the root and then they stay through the document<br>
&lt;emilio> ... or do they change (both?) when I change accent color<br>
&lt;emilio> fantasai: what emilio is proposing is binding to the element you set them on and then they stay fixed<br>
&lt;Rossen9> ack miriam<br>
&lt;fantasai> s/fixed/fixed as they inherit/<br>
&lt;emilio> ... alternative is to have them as keywords and let them change if accent-color changes<br>
&lt;kbabbitt> q+<br>
&lt;fantasai> s/changes/changes in a descendant/<br>
&lt;emilio> miriam: but then you change accent color and it changes both?<br>
&lt;emilio> fantasai: think we can resolve to do the easier thing (eager resolution) and come back if we hit a use cases that needs it<br>
&lt;fantasai> s/needs it/needs it late/<br>
&lt;fantasai> emilio: I'm fine resolving; but if some concerns with resolving at computed value time then happy to ?<br>
&lt;lea> what about color-scheme and canvas/canvastext?<br>
&lt;emilio> s/?/elaborate<br>
&lt;fantasai> emilio: canvas/CanvasText does eager resolution against color-scheme<br>
&lt;emilio> kbabbitt: little confused because two keywords (accentcolor/accentcolortext)<br>
&lt;emilio> ... the accent-color property influences accentcolor<br>
&lt;miriam> yes, I also have @lea'a question above<br>
&lt;emilio> ... what about accentcolortext<br>
&lt;emilio> ... wouldn't that mess up the contrast<br>
&lt;fantasai> miriam, lea: those resolve at computed value time; emilio is proposing to match them essentially<br>
&lt;fantasai> emilio: same way accent-color affect background of checkbox, but also adjusts tickmark so you can still see it<br>
&lt;fantasai> emilio: you would do same with AccentColorText<br>
&lt;fantasai> emilio: ensures contrast between the two<br>
&lt;miriam> fantasai - the question is about updating them in the document as the color-scheme changes<br>
&lt;fantasai> emilio: you can't specify the exact color of the checkmark, similar with AccentColorText<br>
&lt;fantasai> kbabbitt: what's the intended relationship between these two?<br>
&lt;fantasai> emilio: one is background other is foreground<br>
&lt;fantasai> miriam, the answer to that question is it binds at computed value time<br>
&lt;fantasai> emilio: AccentColor will be what you specify in accent-color<br>
&lt;fantasai> emilio: and AccentColorText will be the foreground color associated with that accent-color<br>
&lt;lea> q?<br>
&lt;lea> q+<br>
&lt;Rossen9> ack kbabbitt<br>
&lt;fantasai> emilio: I don't think there's a precise algorithm, but UAs do have one (that may or may not be fully interoperable but nonetheless ensures contrast)<br>
&lt;emilio> lea: I thought we resolved on when do they resolve?<br>
&lt;emilio> fantasai: didn't resolve on anything<br>
&lt;emilio> lea: what are we discussing?<br>
&lt;emilio> ... my understanding was that the primary objection was florian<br>
&lt;emilio> ... did miriam ask about canvas/canvastext<br>
&lt;emilio> fantasai: yeah<br>
&lt;emilio> lea: is the proposal to do the same for these?<br>
&lt;emilio> fantasai: yeah<br>
&lt;emilio> lea: why not doing that?<br>
&lt;emilio> fantasai: we haven't concluded yet<br>
&lt;emilio> lea: why not?<br>
&lt;Rossen9> ack lea<br>
&lt;fantasai> PROPOSED: AccentColor takes its value from accent-color, and AccentColorText takes its value from the appropriately contrasting foreground color for AccentColor; these resolve at computed value time<br>
&lt;emilio> RESOLVED: AccentColor takes its value from accent-color, and AccentColorText takes its value from the appropriately contrasting foreground color for AccentColor; these resolve at computed value time<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5900#issuecomment-2380321760 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 28 September 2024 00:43:10 UTC