W3C home > Mailing lists > Public > public-css-archive@w3.org > June 2020

Re: [csswg-drafts] [css-color-5] color-contrast needs another comma (#5087)

From: CSS Meeting Bot via GitHub <sysbot+gh@w3.org>
Date: Wed, 03 Jun 2020 23:26:44 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-638512636-1591226803-sysbot+gh@w3.org>
The CSS Working Group just discussed `color-contrast needs another comma`, and agreed to the following:

* `RESOLVED: Use vs in color-constrast function`

<details><summary>The full IRC log of that discussion</summary>
&lt;heycam> Topic: color-contrast needs another comma<br>
&lt;heycam> github: https://github.com/w3c/csswg-drafts/issues/5087<br>
&lt;TabAtkins> yeah let's move on for the moment<br>
&lt;heycam> leaverou: I can take this<br>
&lt;heycam> ... right now we have the color-contrast function accepting a bg color and a list of fg colors<br>
&lt;heycam> ... supposed to choose the most contrasting color<br>
&lt;heycam> ... the first is space separated, the rest are commad separated<br>
&lt;heycam> ... makes it looks like the two are grouped together<br>
&lt;heycam> ... so this is a syntax issue, how do we make sure the first color stands out, and the comma separated ones are grouped togetehr<br>
&lt;heycam> ... one proposal is to use a comma, like in gradients<br>
&lt;heycam> ... another is to use a keyword like "versus" or "on" or "over"<br>
&lt;dino> document.getElementById("lea").playbackRate *= 0.5;<br>
&lt;heycam> ... another is to use a slash. a problem with that is inconsistent with other CSS, without parens or something, the slash has a different precedence compared to backgrounds<br>
&lt;heycam> chris: one other thing is that the first element is typically a background, but doesn't have to be<br>
&lt;heycam> leaverou: right if you reverse the colors you still get the same result<br>
&lt;heycam> florian: in terms of keywords, "against" might work to avoid indicating which is fg or bg<br>
&lt;heycam> chris: I also liked "vs"<br>
&lt;heycam> ... that would be my first choice<br>
&lt;heycam> AmeliaBR: for keywords, another could be "from"<br>
&lt;TabAtkins> I'm fine with "vs" or a plain comma.<br>
&lt;heycam> ... choosing a contrasting color from the list after<br>
&lt;jensimmons> q?<br>
&lt;florian> "vs" works for me<br>
&lt;heycam> ... syntax wise I prefer slash, but the concern about all the new color functions consistently using slash to separate the alpha value might be an issue<br>
&lt;heycam> leaverou: that's not a problem, grid-row/column uses slash like this<br>
&lt;heycam> ... but if you have slahes and commas at the same level<br>
&lt;jensimmons> q+<br>
&lt;heycam> ... if you have color / color+, it looks like the first two colors are grouped<br>
&lt;heycam> AmeliaBR: I don't think that's an issue or really consistent<br>
&lt;AmeliaBR> `color-contrast(wheat / tan, sienna)`<br>
&lt;heycam> leaverou: is there precedent for the opposite?<br>
&lt;heycam> TabAtkins: it is true that all the places we mix slash and comma, that slash is subordinate to the comma<br>
&lt;heycam> ... don't think that's necessarily a problem, but I'm fine with using a keyword here<br>
&lt;jensimmons> q?<br>
&lt;heycam> ... if we explicitly want to keep slash as a weaker precedence<br>
&lt;heycam> leaverou: also there's an option of using a function<br>
&lt;heycam> jensimmons: I hear people saying they like "vs", but I really don't<br>
&lt;Rossen_> ack jensimmons<br>
&lt;heycam> ... it doesn't feel expected from the PoV of authors<br>
&lt;heycam> ... I appreciate the consistency argument. is there another symbol we can use?<br>
&lt;heycam> leaverou: what about a function, that definitely makes the grouping obvious<br>
&lt;dino> (not so firm) vote for not using the / to avoid this inconsistent grouping/alternate issue, but i like / more than vs<br>
&lt;heycam> AmeliaBR: most cases that means having triple nested parens<br>
&lt;heycam> Rossen_: what about the "from" keyword?<br>
&lt;heycam> ... sounds fairly intuitive<br>
&lt;heycam> florian: if we're going with a keyword, I like vs better<br>
&lt;heycam> leaverou: I like against and vs better than from<br>
&lt;fantasai> +1 to leaverou<br>
&lt;heycam> argyle: [...]<br>
&lt;chris> vs for me too<br>
&lt;AmeliaBR> `color-contrast(var(--fg) from #002, #ffa)` `color-contrast(var(--fg) vs #002, #ffa)`<br>
&lt;heycam> myles: sounds like there's not argreement on keywords<br>
&lt;heycam> jensimmons: I really don't like it<br>
&lt;heycam> fantasai: there's keywords in gradients<br>
&lt;heycam> leaverou: I think the ship has sailed<br>
&lt;dino> LET'S USE EMOJI!<br>
&lt;heycam> argyle: I like keywords but vs doesn't feel right<br>
&lt;heycam> leaverou: to me keywords read like natural language which I think is something to strive for<br>
&lt;fantasai> s/vs doesn't feel right/against feels very English/<br>
&lt;heycam> ... keywords the precedence is still not completely clear<br>
&lt;astearns> prefers keywords to most magic-punctuation syntax<br>
&lt;heycam> myles: I'm not sure that's something to strive for<br>
&lt;fantasai> s/against/against I like against, but it/<br>
&lt;heycam> ... I don't think it'd be a good idea for properties to be full english sentences<br>
&lt;heycam> Rossen_: we also have a resolution to allow commas everywhere!<br>
&lt;AmeliaBR> q?<br>
&lt;heycam> myles: I don't think we do, I posted about that last week<br>
&lt;heycam> AmeliaBR: I think also, while discussing this, important to remember how this function works<br>
&lt;heycam> ... which I wasn't thinking of when I suggested keywords<br>
&lt;heycam> ... but you're picking a value from the list, contrasting it against the first value<br>
&lt;jensimmons> |<br>
&lt;heycam> ... it's the list you're picking from<br>
&lt;heycam> argyle: it sounds nice when you put it that way<br>
&lt;faceless2_> I think a keyword over /, I can't get past the precedence issue. commas just seem naturally lower priority than slash<br>
&lt;heycam> Rossen_: are we more leaning towards using "against"?<br>
&lt;heycam> ... if we used versus would it be abbreviated?<br>
&lt;heycam> florian: I hope so<br>
&lt;heycam> Rossen_: we don't use abbreviations anywhere else?<br>
&lt;heycam> plinss: only every unit type<br>
&lt;heycam> TabAtkins: "vs" is pretty universal<br>
&lt;heycam> dbaron: except in the legal system in the US, where it's "v"!<br>
&lt;TabAtkins> video game *and* movies<br>
&lt;chris> vs<br>
&lt;argyle> vs<br>
&lt;heycam> chris: let's go with vs<br>
&lt;heycam> leaverou: I'm fine with vs<br>
&lt;heycam> Rossen_: any objections to adding vs to the color-contrast function?<br>
&lt;AmeliaBR> ``color-contrast(var(--fg) vs #002, #ffa)`<br>
&lt;Rossen_> color-contrast(wheat vs tan, sienna, var(--myAccent), #d2691e)<br>
&lt;leaverou> color-contrast(wheat vs tan, sienna, var(--myAccent), #d2691e)<br>
&lt;heycam> dino: can someone type an example?<br>
&lt;TabAtkins> color-contrast(wheat vs tan, #00ff00, var(--foo))<br>
&lt;chris> yay!<br>
&lt;heycam> RESOLVED: Use vs in color-constrast function<br>
&lt;argyle> very nice<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5087#issuecomment-638512636 using your GitHub account
Received on Wednesday, 3 June 2020 23:26:48 UTC

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