Re: [csswg-drafts] [css-color-adjust-1][mediaqueries-5] Clearly define what 'light' and 'dark' mean (#3983)

The CSS Working Group just discussed `definition of light and dark`, and agreed to the following:

* `RESOLVED: Add a note to color-scheme to warn authors that the exact colors for dark and light mode are not specified, and that if they need to guarantee contrast against their own colors, they need to specify both foreground and background pairs.`
* `RESOLVED: Add a note to color-scheme to warn authors that dark and light modes are not necessarily black and white colors, and that if they are specifying any of their own colors they should specify enough colors to satisfy WCAG requirements (with a link)`

<details><summary>The full IRC log of that discussion</summary>
&lt;fremy> Topic: definition of light and dark<br>
&lt;astearns> github: https://github.com/w3c/csswg-drafts/issues/3983<br>
&lt;emilio> ScribeNick: emilio<br>
&lt;emilio> AmeliaBR: So I wrote this up after the last telcon<br>
&lt;emilio> ... we were talking about sepia mode, and whether we needed a new keyword<br>
&lt;emilio> ... it came up that sepia is usually a dark text on light background which match light<br>
&lt;emilio> ... people assume that the default colors for light / dark mode are white / black<br>
&lt;emilio> ... and if we want more flexibility of color schemes but still group them into light / dark / etc. then we need to have some sort of normative definition of what do they mean<br>
&lt;emilio> ... i.e., how far can you adjust those while being light or dark<br>
&lt;hober> q+<br>
&lt;emilio> ... I put an example with yellow / bright blue on the issue, I'd be surprised if authors would expect a light theme to have those colors<br>
&lt;emilio> ... if authors use system colors or such and only use the preferred media query then having the variety could be problematic<br>
&lt;emilio> ... so I think we should define what's the scope of variation for these definition<br>
&lt;emilio> ... I posted some suggestions using the contrast definition, because that's a very important factor<br>
&lt;emilio> ... but we may want to limit saturation as well for example<br>
&lt;astearns> q+ heycam<br>
&lt;emilio> hober: disclaimer: I don't know about colors but I'm channeling feedback<br>
&lt;emilio> ... it's probably fine to have light / dark being somewhat generic<br>
&lt;emilio> ... I'm a little wary of including specific colors in that definition<br>
&lt;emilio> ... for example in Mac there's a fairly specific algorithm<br>
&lt;jensimmons> q+<br>
&lt;emilio> ... but yeah something that says "this needs to have enough contrast" sounds good<br>
&lt;astearns> ack heycam<br>
&lt;hober> s/I don't know about colors//<br>
&lt;emilio> heycam: I'm a bit skeptical about how much we need to worry about custom background and foreground colors set by the user and have sites be able to respond to all of those<br>
&lt;emilio> ... seems pretty niche, and if browsers wanted to decide whether they're light or dark that seems fine<br>
&lt;emilio> ... but probably this doesn't warrant spending a lot of time figuring out a precise authors<br>
&lt;emilio> AmeliaBR: this is also about potential future changes of OS-provided colors<br>
&lt;emilio> florian: seems like the OS vendor should be the one figuring that out<br>
&lt;fantasai> +1 to Florian<br>
&lt;hober> s/in Mac there's a fairly specific/macOS Mail has a complex/<br>
&lt;emilio> AmeliaBR: it's kind of awkward that this is the first issue we talk about this<br>
&lt;jensimmons> q-<br>
&lt;jensimmons> q+<br>
&lt;emilio> ... even something like sepia mode people seem to be clear that it's light, but for authors it doesn't seem so<br>
&lt;emilio> fantasai: may be worth adding a note to that effect to the spec<br>
&lt;Rossen_> q?<br>
&lt;Rossen_> ack jensimmons<br>
&lt;emilio> jensimmons: I'm unclear about what do you want us to write up, it's some kind of fence about where default background / colors can be? And if so why a fence and not a specific value?<br>
&lt;emilio> ... But this is also about the WG teaching designers to do the right thing<br>
&lt;emilio> ... and I don't think that that may be the right thing to reach them<br>
&lt;emilio> ... I also don't particularly agree that they would assume black / white<br>
&lt;emilio> ... I'd like to talk about it but it's probably not WG's business<br>
&lt;emilio> AmeliaBR: my main focus is about UAs but also about whether we should have different color schemes for the media queries but not for the properties<br>
&lt;emilio> ... I think we cannot resolve this issue without deciding how to group color schemes<br>
&lt;Rossen_> q?<br>
&lt;emilio> ... and are authors aware about it/<br>
&lt;emilio> ... because people are implementing different thing<br>
&lt;emilio> fantasai: spec says dark / light, no black / white, so we could add a note<br>
&lt;emilio> AmeliaBR: the issue is contrast, if the author assumes it's a black background for contrast requirements and the background ends up grey then there may not be enough contrast<br>
&lt;Rossen_> q+<br>
&lt;emilio> ... so my proposal is to define the min luminance ratio so that we can guarantee that authors meet requirements which may be a legal obligation<br>
&lt;emilio> jensimmons: ...<br>
&lt;emilio> jensimmons: Authors are probably going to be picking both background and foreground colors<br>
&lt;astearns> ack Rossen_<br>
&lt;emilio> Rossen_: When I was going about how high-contrast is implemented on windows<br>
&lt;jensimmons> jensimmons: we can add text to the spec to remind everyone that color contrast is important. In notes.<br>
&lt;emilio> ... There are three different ways of color-scheme propagation<br>
&lt;emilio> ... the os one (which doesn't propagate to the browser at least on windows)<br>
&lt;emilio> ... so for example the shell started to ship dark mode but none of the apps were opted in<br>
&lt;emilio> ... then there's the author of the application opting in to the UI of the application<br>
&lt;emilio> ... then there's the propagation into the content. high-contrast propagates all the way forcibly<br>
&lt;emilio> ... for color schemes, first there are not many colors to begin with, authors should be able to make pretty well educated guesses<br>
&lt;jensimmons> q?<br>
&lt;emilio> ... if the colors are what we need to expose, we already have this and decided to undeprecate the system colors<br>
&lt;emilio> ... and they would have an effect however the browser manages to get them there<br>
&lt;emilio> ... you can also opt individual apps into force colors mode (e.g., only the browser)<br>
&lt;emilio> ... none of this involves sepia btw<br>
&lt;emilio> ... though it's a reasonable expectation on content<br>
&lt;emilio> ... as we're going down this path it's best to have an easily detectable mechanism to figure out whether (1) I'm forced (2) what's the general preference (light / dark) (3) and a way to identify the individual colors so that you can programatically address them<br>
&lt;emilio> ... so my question is, what's missing in the platform so that authors can make these decisions<br>
&lt;emilio> AmeliaBR: for this specific issue we're just looking at the colors that came down to the content<br>
&lt;emilio> ... so your question is "we got the system colors, why would we need to define them more or less"<br>
&lt;jensimmons> q+<br>
&lt;emilio> ... one answer could be telling authors "just stick with system colors"<br>
&lt;emilio> ... but if we acknowledge that system colors won't be enough, then you need a way to figure out the variance<br>
&lt;emilio> Rossen_: wdym with system colors not being enough?<br>
&lt;emilio> AmeliaBR: if you also have your own brand color or such<br>
&lt;emilio> ... color mod functions may be enough?<br>
&lt;emilio> ... but right now we've got a system where people designing for dark mode make assumptions of what system colors look like<br>
&lt;emilio> ... so we need to either educate or limit dark mode to define what the range<br>
&lt;emilio> Rossen_: the UA UI-color choice is not something we should be demanding<br>
&lt;emilio> ... currently all of the color schemes that are propagated down are based on this matching the ui<br>
&lt;emilio> jensimmons: I think it's fine if we want to add notes and such in the spec<br>
&lt;emilio> ... but this proposal is to pin point what light and dark mean and I don't think we want to do that<br>
&lt;Rossen_> q?<br>
&lt;Rossen_> ack jensimmons<br>
&lt;emilio> ... we don't do that in a bunch of places and try to teach people how to use media queries<br>
&lt;bkardell_> we do sometimes *<br>
&lt;emilio> ... I don't share the premise of authors making assumptions about system colors<br>
&lt;tantek> bkardell_: indeed, it would be interesting to list all the places we reference WCAG* from CSS* specs<br>
&lt;tantek> in terms of author guidance<br>
&lt;emilio> ... it's not clear if  we are entering an era where we have OSes have dark and light mode with a bunch of colors, or all the way to a heavily customized sites like in the old days<br>
&lt;bkardell_> https://www.w3.org/TR/css-flexbox-1/#order-accessibility<br>
&lt;emilio> ... I don't think we should define this without knowing where this is going<br>
&lt;Rossen_> q?<br>
&lt;AmeliaBR> q?<br>
&lt;emilio> ... and I think people are caring more and more about contrast and such<br>
&lt;emilio> hober: I agree with what jensimmons just said<br>
&lt;emilio> bkardell_: I thought hober said said that the spec could mention should have specific contrast<br>
&lt;emilio> jensimmons: well we could do add a somewhat vague note, but not finding a precise definition<br>
&lt;astearns> ack dbaron<br>
&lt;emilio> AmeliaBR: one way to solve this would be adding a warning to the spec to tell authors not to make assumptions about them<br>
&lt;emilio> dbaron: I think one of the problems we've had in the past is that when the platform has too many degrees of freedom in it, developers aren't able to test what they're doing well enough<br>
&lt;emilio> ... I spent a lot of time in the past dealing with GTK themes in the Firefox UI<br>
&lt;emilio> ... so I had to write a debugging mode where I would customize the light / background color, and ensuring that setting front / back colors were matched<br>
&lt;emilio> ... but they're extremely hard to test<br>
&lt;emilio> ... I think light / dark would be ok, but if you expose too many degrees of freedom<br>
&lt;emilio> ... then you break the users that have the weird settings<br>
&lt;florian> q+<br>
&lt;emilio> astearns: so you would oppose to add a note to the spec and would want something more normative?<br>
&lt;emilio> dbaron: I'm fine with a note as long as it's something for which authors can reasonably test, which I think this is<br>
&lt;emilio> AmeliaBR: so thinking about what that specific note should look like I think it should be focusing on the system colors (which includes using a color scheme and not specifying background / text colors)<br>
&lt;emilio> ... in that case we should encourage authors to use them in a very dedicated set<br>
&lt;emilio> ... that way if those pairs don't have enough contrast then it's the user choice<br>
&lt;emilio> ... but if you mix the colors with your on colors then you're also responsible<br>
&lt;tantek> Is there any existential evidence of *any* web designer or web site of authors using system colors in such pairs or very dedicated sets?<br>
&lt;emilio> ... (puts some example about some win10 dialog not working in high contrast)<br>
&lt;tantek> Many years ago I tried to do so and was one of the reasons why I gave up on System Colors<br>
&lt;emilio> dbaron: I think that goes well beyond what we can reasonably ask authors to do<br>
&lt;tantek> q?<br>
&lt;tantek> q+<br>
&lt;emilio> ... if you want that kind of stuff we need to write tools for that because they're not going to get it right<br>
&lt;florian> q-<br>
&lt;emilio> ... and I think we should ensure that light / dark mode should be coherent enough<br>
&lt;astearns> ack tantek<br>
&lt;emilio> tantek: specific response to AmeliaBR: without any successful evidence of authors doing so, it's irresponsible and a bit arrogant from us to tell authors what to do<br>
&lt;emilio> astearns: I suggest adding a note to the spec mentioning that light / dark themes won't always be white / black<br>
&lt;emilio> fantasai: there is such a note IIRC<br>
&lt;emilio> ... we can add a note in the color spec to tell it that system colors should be used in pairs<br>
&lt;emilio> tantek: i'd object to that<br>
&lt;emilio> astearns: is the light / dark theme note ok?<br>
&lt;emilio> tantek: that seems fine<br>
&lt;emilio> ... we should not give authors advice without evidence<br>
&lt;tantek> I specifically object to all the assumption about "pairs of system colors"<br>
&lt;emilio> jensimmons: I'd propose to have the note say "don't assume light / dark means white / black", and "think of color contrast"<br>
&lt;tantek> q?<br>
&lt;emilio> fremy: I think that's the point, we can't compute contrast correctly, we went all around<br>
&lt;emilio> ... (repeats the initial proposal about the minimmum contrast / darkness / lightness)<br>
&lt;tantek> I also said that any such advice should be checked with WCAG and if we can't find a WCAG citation for the advice, we should assume that there's a good chance we may be mistaken<br>
&lt;emilio> Rossen_: you can choose your own colors, if you want to follow WCAG<br>
&lt;AmeliaBR> q+ to wrap up with some proposals<br>
&lt;emilio> ... that's all we're saying<br>
&lt;emilio> astearns: I'm happy with jensimmons' suggestions<br>
&lt;emilio> fremy: it's about UA advice<br>
&lt;emilio> Rossen_: no it's not<br>
&lt;tantek> in some cases WCAG suggestions may be necessary but not sufficient, that is, it is possible there are WCAG recommendations that are not backed by evidence or possibly even existence<br>
&lt;emilio> fremy: it is, we have color provided by UA and you cannot apply WCAG if you don't know the color<br>
&lt;bkardell_> +1 to what jen said, that is what I was suggesting we were all saying in several ways<br>
&lt;emilio> emilio: I think Rossen_'s point makes sense, we expose these colors in getComputedStyle, and you can adhere to the guidelines with either color-modifying functions, JS, or using system colors<br>
&lt;emilio> AmeliaBR: I agree with fremy that we can't say "you can't know what the color is, but care about contrast"<br>
&lt;fantasai> s/there is such a note IIRC/we can add a note that "light" doesn't mean "black on white"/<br>
&lt;emilio> ... we can say "you don't know the colors, so if you use non-system colors you should set your background / foreground"<br>
&lt;fremy> +1 to what AmeliaBR just said, that would be acceptable to me<br>
&lt;emilio> ... we should also tell the system colors that are supposed to go together<br>
&lt;emilio> ... so those are my two recommendations<br>
&lt;tantek> going to state that system color "pairings" are fundamentally broken and we shouldn't even pretend that it's anything remotely workable for authors<br>
&lt;emilio> ... one saying that you don't know what you're going to get<br>
&lt;fantasai> +1 to AmeliaBR's proposal<br>
&lt;dbaron> opposed to Amelia's proposal<br>
&lt;emilio> ... and another for the pairs system colors are supposed to be used together<br>
&lt;tantek> -1 to any even description of such "pairings" because no one has actually made them work<br>
&lt;dbaron> we've been telling people to specify foreground and background colors together for 20 years, and it hasn't worked<br>
&lt;tantek> even without any "shoulds"<br>
&lt;emilio> astearns: so we have agreement on the first note but not on the system color stuff<br>
&lt;dbaron> if it had worked, we'd have been able to do dark system colors by default without pages having to opt in<br>
&lt;emilio> ... so I propose resolving for the first<br>
&lt;emilio> dbaron++<br>
&lt;tantek> dbaron's analysis is correct<br>
&lt;emilio> astearns: and leave the pairing of system colors for another time<br>
&lt;emilio> astearns: objections<br>
&lt;tantek> I'd like to close on "pairs" of system colors until someone comes back with actual new information / evidence that such "pairings" are workable<br>
&lt;fantasai> tantek, it's required for authors to work with such pairs for MSFT forced-colors mode<br>
&lt;AmeliaBR> and the system colors as a concept are unworkable without pairs<br>
&lt;tantek> fantasai I don't believe you - show me such an example<br>
&lt;AmeliaBR> RESOLVED: Add a note to color-scheme to warn authors that the exact colors for dark and light mode are not specified, and that if they need to guarantee contrast against their own colors, they need to specify both foreground and background pairs.<br>
&lt;astearns> s/RESOLVED: Add a note to color-scheme to warn authors that the exact colors for dark and light mode are not specified, and that if they need to guarantee contrast against their own colors, they need to specify both foreground and background pairs.//<br>
&lt;astearns> RESOLVED: Add a note to color-scheme to warn authors that dark and light modes are not necessarily black and white colors, and that if they are specifying any of their own colors they should specify enough colors to satisfy WCAG requirements (with a link)<br>
&lt;fantasai> ScribeNick: fantasai<br>
</details>


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

Received on Wednesday, 5 June 2019 20:23:57 UTC