Re: [csswg-drafts] [css-scrollbars] What do (semi) transparent colors mean for scrollbar-color (#9853)

The CSS Working Group just discussed `[css-scrollbars] What do (semi) transparent colors mean for scrollbar-color`.

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> florian: Spec doesn't say what happens to transparent/semi-transparent colors if you specify them<br>
&lt;fantasai> florian: you could ignore the alpha channel<br>
&lt;fantasai> florian: or pre-composite against some color, maybe white, maybe white or black depending on 'color-scheme'<br>
&lt;fantasai> florian: maybe transparent thumb over track is possible, but track is opaque<br>
&lt;fantasai> florian: variety of possible options<br>
&lt;fantasai> florian: e.g. emilio just mentioned making thumb and track invisible<br>
&lt;fantasai> florian: but what about partially transparent?<br>
&lt;fantasai> florian: does the non-colored part of the scrollbar also become invisible?<br>
&lt;fantasai> florian: there's no requirement that scrollbar contains only thumb and track<br>
&lt;fantasai> florian: but in the past, and in some systems still, scrollbars could have up/down buttons as well<br>
&lt;fantasai> florian: do these become invisible as well?<br>
&lt;flackr> q+<br>
&lt;emilio> q+<br>
&lt;fantasai> florian: which options seem reasonable?<br>
&lt;fantasai> florian: Lea commented that alpha channel shouldn't be ignored<br>
&lt;fantasai> florian: suggested pre-composing against white/black<br>
&lt;astearns> ack flackr<br>
&lt;fantasai> florian: or 'canvas', is equivalent to lack/white?<br>
&lt;fantasai> emilio: not necessarily<br>
&lt;fantasai> flackr: Color used for thumb makes sense to apply to other buttons<br>
&lt;fantasai> flackr: maybe make that explicit?<br>
&lt;fantasai> flackr: for transparency, I can see use-cases for semi-transparent thumbs<br>
&lt;fantasai> flackr: maybe make them look frosted or osmething<br>
&lt;fantasai> flackr: maybe keeping their transparency to some extent allowed<br>
&lt;fantasai> flackr: but I don't think the rest of the scroll controls should be made more transparent<br>
&lt;fantasai> flackr: UA should be free to make it clear that the scroll thumb is there<br>
&lt;fantasai> flackr: to be interacted with<br>
&lt;astearns> ack emilio<br>
&lt;florian> q+<br>
&lt;fantasai> emilio: I also have a preference to not special-case transparency<br>
&lt;fantasai> emilio: let stuff be semi-transparent as much as the UA can deal with it<br>
&lt;fantasai> emilio: is there a good reason to not do that?<br>
&lt;fantasai> florian: Here, we're charging to supply both the foreground and background, and thereby ensuring good contrast<br>
&lt;PaulG> q+<br>
&lt;fantasai> florian: They need to know if the alpha channel will be ignored, composed against lack/white, or against content below?<br>
&lt;ntim> +1 to "as the UA can deal with it", some system frameworks may not support it<br>
&lt;fantasai> florian: whichever one we choose, needs to be consistent so author can choose properly contrasting colors<br>
&lt;astearns> ack emilio<br>
&lt;astearns> ack florian<br>
&lt;TabAtkins> fantasai: I agree withi everythign florian said<br>
&lt;astearns> ack fantasai<br>
&lt;TabAtkins> fantasai: ADditional point, let's say you decide to honor the color *and* transparency<br>
&lt;TabAtkins> fantasai: And on one system they use black scrollbars, just an oval on a rectangle, flat color, no distinguishing features<br>
&lt;TabAtkins> fantasai: If you make both thumb and track transparent, it's invisible<br>
&lt;TabAtkins> fantasai: But on another system there's an aqua effect, 3d with some shading<br>
&lt;TabAtkins> fantasai: That shading will exist on a fully transparent bar<br>
&lt;TabAtkins> fantasai: So on that page the scrollbar will still be visible, just "clear"<br>
&lt;TabAtkins> fantasai: So I think we need some kidn of consistency so when an author gets one effect vs the other...<br>
&lt;TabAtkins> fantasai: So if they dev on Mac OS 2001 it looks good, but Mac 2011 you can't see anything at all...<br>
&lt;florian> q?<br>
&lt;TabAtkins> fantasai: So whethe rit's visible and has enough contrast varies depending on style, if you honor transparent colors<br>
&lt;TabAtkins> fantasai: So we need to make sure an author working on one platform can know whether their styles will make a visible or invisible scrolblar, on all platforms<br>
&lt;astearns> ack PaulG<br>
&lt;florian> q+<br>
&lt;emilio> q+<br>
&lt;fantasai> PaulG: I brought up with APA, they offered to help with the language<br>
&lt;fantasai> PaulG: and ensuring contrast/affordances etc.<br>
&lt;fantasai> PaulG: Consistency helps everyone, but even if not consistent, APA is comfortable going forward as long as articulated<br>
&lt;astearns> ack florian<br>
&lt;fantasai> florian: Given fantasai's argument, that pushes us towards precomposing, to get you reliable colors<br>
&lt;fantasai> florian: you could still end up with white-on-white and black-on-black and have that be visible with shading and invisible otherwise<br>
&lt;astearns> ack emilio<br>
&lt;fantasai> florian: but if doing foreground and background are the same, you'll have issues on some platforms -- most platforms currently<br>
&lt;fantasai> emilio: I think we should at least specify that if you provide 0 alpha channel, then the whole thing is transparent, because that's a reasonable use case<br>
&lt;fantasai> florian: why? why not use other ways of making invisible<br>
&lt;kizu> q+<br>
&lt;fantasai> emilio: same as having any element invisible<br>
&lt;fantasai> emilio: use case was showing scrollbar on :hover without layout shift. You can do with scrollbar gutter nowadays but still useful to not have to do any layout to show a scrollbar<br>
&lt;fantasai> emilio: I don't think we need to specify semitransparent colors super deeply<br>
&lt;fantasai> emilio: forcing you to compose on a flat color, that's a bit weird.<br>
&lt;fantasai> emilio: E.g. on linux/firefox you only show thumb. Track is mostly transparent.<br>
&lt;florian> q+<br>
&lt;fantasai> emilio: I think we should leave the rendering of most of these semitransparent colors up to UA and how they can provide a good scrollbar with what they get<br>
&lt;astearns> ack fantasai<br>
&lt;fantasai> fantasai: If we want invisible scrollbars, have a keyword for that. Transparent won't guarantee invisible scrollbars<br>
&lt;fantasai> emilio: I don't feel super strongly, but fading a scrollbar by animating alpha channel is nice<br>
&lt;TabAtkins> fantasai: if scrollbar is shared, it'll aniamte from clear to purple or wahtever, it just won't actuallyb e invisible because the shading will be there<br>
&lt;fantasai> emilio: I don't think current platforms do shading<br>
&lt;astearns> s/shared/shaded/<br>
&lt;fantasai> emilio: if fully transparent is actually invisible, then the animation would work in such a platform<br>
&lt;flackr> q+<br>
&lt;astearns> ack kizu<br>
&lt;fantasai> kizu: Maybe this could be considered alongside another issue, 9855 about the track and overlay scrollbars and setting colors<br>
&lt;fantasai> kizu: if we could require UAs to make the thumb and track to always have contrast, we should do it<br>
&lt;fantasai> kizu: and then we might make an exception for completely transparent scrollbars for authors that want to make it completely invisible but still take space<br>
&lt;fantasai> kizu: I'm not sure if we want to provide this use case, or always want hidden scrollbars [missed]<br>
&lt;fantasai> kizu: issue with making this a special case is that it might not work for UAs for transitions, if you want to have scrollbar appear if UA chooses to precompose colors against some other colors<br>
&lt;fantasai> kizu: if we precompose completely invisible, at zero it disappears immediately. That's maybe an issue<br>
&lt;astearns> ack florian<br>
&lt;fantasai> florian: I'm open to a variety of option, but what is not reasonable is to not specify<br>
&lt;fantasai> florian: if the author can't know if precomposed over white or black or actual element background, they can't ensure their colors provide contrast<br>
&lt;fantasai> florian: because they don't know what their colors mean<br>
&lt;fantasai> florian: so we can't allow one or the other, we have to pick one.<br>
&lt;fantasai> florian: Emilio is leaning towards "don't precompose"<br>
&lt;fantasai> florian: Another question in another issue about whether you're required to paint the track at all in overlay scrollbars, hoping to keep separate<br>
&lt;emilio> q+<br>
&lt;astearns> ack flackr<br>
&lt;fantasai> florian: desire that you see things the same suggests an alternative, require that we use the opacity from the color for the rest of the painting even if it is shaded<br>
&lt;ntim> Some system frameworks don't support alpha, so if we specify anything i'd rather have it be simple<br>
&lt;fantasai> s/florian/flackr/<br>
&lt;fantasai> flackr: unsure if that's ideal, but would allow things to fade consistently<br>
&lt;fantasai> flackr: but maybe if fully transparent don't want it to hit test either<br>
&lt;fantasai> flackr: so maybe separate property<br>
&lt;astearns> ack fantasai<br>
&lt;TabAtkins> fantasai: If fading the scrollbar is something people really want, we shoul dhave scrollbar-opacity that controls it all, including the parts the author isn't coloring<br>
&lt;TabAtkins> fantasai: Lots of things potentially in a scrollbar that potentially aren't under author control<br>
&lt;astearns> ack emilio<br>
&lt;TabAtkins> fantasai: But downside of making it transparent when not hovering - if the element has focus but not hovering, and someone assuming it's only scrolalble when there are scrollbars, someone using a differnet mechanism won't know it's scrolalble<br>
&lt;florian> qq+<br>
&lt;fantasai> emilio: similar thing with accent-color, and e.g. Chromium ignores alpha channel, Firefox tries to deal with it, and unsure about WebKit<br>
&lt;ntim> AppKit doesn't support changing scrollbar colors, so neither does WebKit<br>
&lt;fantasai> florian: answer might be the same, but for accent-color, it is different because in that case the author is only providing one color -- UA is charged with providing good contrast<br>
&lt;emilio> *?<br>
&lt;fantasai> florian: but for scrollbars, the author needs to ensure contrast<br>
&lt;fantasai> florian: Either UA ensures contrast, or we specify how the colors composite so the author can know whether they get good contrast<br>
&lt;astearns> ack florian<br>
&lt;Zakim> florian, you wanted to react to emilio<br>
&lt;bramus> q?<br>
&lt;fantasai> astearns: I think I'm convinced that we should not try to solve the fully-transparent case with scrollbar colors because there are other bits of the scrollbar which may not be under these colors' control<br>
&lt;fantasai> astearns: I find that logic compelling<br>
&lt;ntim> WebKit does ignore alpha for accent-color<br>
&lt;fantasai> florian: if we go that way, then do we specify semi-transparent colors to be pre-composed? I think these two go together...<br>
&lt;fantasai> astearns: yes, but less convinced about that<br>
&lt;fantasai> astearns: Anyone want to argue for ignoring alpha channels in scrollbar colors entirely?<br>
&lt;fantasai> florian: What you propose seems reasonable, may be other options<br>
&lt;ntim> pre-composing is hard because we don't know what background to use<br>
&lt;fantasai> astearns: 2 options are ignoring or pre-composing<br>
&lt;fantasai> fantasai: Lots of points brought up in this discussion, might be good to list the good options and pros/cons, and resolve later<br>
</details>


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


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

Received on Wednesday, 20 March 2024 17:02:44 UTC