- From: CSS Meeting Bot via GitHub <sysbot+gh@w3.org>
- Date: Tue, 09 Feb 2021 17:25:30 +0000
- To: public-css-archive@w3.org
The CSS Working Group just discussed `::indicator pseudo-element`. <details><summary>The full IRC log of that discussion</summary> <TabAtkins> Topic: ::indicator pseudo-element<br> <TabAtkins> github: https://github.com/w3c/csswg-drafts/issues/5914<br> <TabAtkins> gregwhitworth: Proposal for an ::indicator pseudo<br> <TabAtkins> gregwhitworth: Problem is appearance of checkbox and radio controls vary greatly across browsers<br> <TabAtkins> [shows slide of different browser checkboxes]<br> <TabAtkins> gregwhitworth: Investigating a bunch of components, but checkbox/radio is #2 most cited problem<br> <TabAtkins> gregwhitworth: OpenUI is already working on the more general problem [describes general checkbox internal structure]<br> <TabAtkins> gregwhitworth: So right now I'm just talkinga bout the indicator itself<br> <TabAtkins> gregwhitworth: Proposal is ::indicator pseudo on input[type=checkbox] and [radio], selecting the check/dot in the element.<br> <TabAtkins> gregwhitworth: There are probably more indicators, like in range inputs, but not getting to those now, they're more complex.<br> <TabAtkins> gregwhitworth: We saw from accent-color that often the functionality and visuals of a radio/checkbox are fine, they just want to change colors. We don't necessarily want people to ahve to rebuild from the ground up, like appearance:none requires<br> <TabAtkins> gregwhitworth: So interop becomes the questions<br> <TabAtkins> gregwhitworth: We've got a lot of variation cross-brwoser currently, how do we let authors have meaningful customization<br> <TabAtkins> gregwhitworth: I propose there is a "base" keyword for 'appearance', specifying that the widget must render with a standard-defined way.<br> <TabAtkins> [slide shows a standardized checkbox]<br> <fantasai> Better idea: use the checkmark Unicode character<br> <TabAtkins> gregwhitworth: So there would literally be an <svg><path></svg> to render the checkbox, and can thus style with SVG properties<br> <florian> q+<br> <TabAtkins> gregwhitworth: So people asked why we needed to go to this level of detail<br> <TabAtkins> gregwhitworth: You don't know what's between the component root and the checkmark<br> <TabAtkins> gregwhitworth: Earlier with password-reveal, our internal structure was actually really complicated, with some funny details that limited authors<br> <TabAtkins> gregwhitworth: So learning from that, we wanted to give authors well-defined DOM/styles that they can work off of<br> <TabAtkins> gregwhitworth: But make it opt-in so everything stays with the native look-and-feel by default<br> <TabAtkins> gregwhitworth: I've built a web component that follows this model, and was able to do a ton of variations [shows off many variations from the same SVG base]<br> <TabAtkins> gregwhitworth: Other possibilities we discarded:<br> <TabAtkins> gregwhitworth: using background-image on ::indicator rather than inline SVG<br> <TabAtkins> gregwhitworth: using a unicode character inside ::Indicator<br> <TabAtkins> gregwhitworth: Both of these, you just don't get the same flexibility<br> <TabAtkins> gregwhitworth: And the interop of unicode characters happens to be very good, but bc it's text you're very limited in what you can control about it<br> <TabAtkins> gregwhitworth: So open questions<br> <leaverou> (Also it's trivial to generate an SVG with a single <text> that contains a unicode character)<br> <TabAtkins> gregwhitworth: What happens if you want to change the graphic entirely?<br> <TabAtkins> [shows off an inverse path on a shield]<br> <leaverou> Question: What would ::indicator { content: "✔️"; } do?<br> <TabAtkins> gregwhitworth: Tangential to this, being able to adjust viewBox via CSS would b euseful for this<br> <TabAtkins> gregwhitworth: So while this gets us 80% there, there are much more ocmplex scenarios<br> <TabAtkins> gregwhitworth: [shows off animation flipping from check to x]<br> <TabAtkins> gregwhitworth: OpenUI's more freeform solution gives you fuller control if you need it<br> <TabAtkins> gregwhitworth: So proposal is we add "appearance:base", and add ::indicator for checkbox/radio to select the check/dot.<br> <emilio> q+<br> <florian> q?<br> <TabAtkins> TabAtkins: Does ::indicator select the <svg> or the <path?<br> <TabAtkins> gregwhitworth: <svg>, so you can control the box<br> <TabAtkins> TabAtkins: Okay so we'll need structure there so you can apply 'd', since it doesn't inherit<br> <TabAtkins> gregwhitworth: Yeah, another pseudo, or [...]<br> <TabAtkins> leaverou: Woudl 'content' property work?<br> <TabAtkins> gregwhitworth: Haven't considered it, would need to think about it.<br> <fantasai> +1 leaverou , exactly what I was going to say<br> <TabAtkins> leaverou: I'd expect 'content' to work, as an author, the same way it works for list markers.<br> <TabAtkins> gregwhitworth: So you'd expect it to cancel out the built-in SVG?<br> <TabAtkins> leaverou: Yes<br> <TabAtkins> fantasai: One of the things on my q would be to say the same thing as Lea.<br> <Rossen_> q<br> <TabAtkins> fantasai: I'd say it should be just a pseudo with 'content' that the UA sets to an SVG<br> <TabAtkins> TabAtkins: If you rely solely on that, the only way to plumb in an SVG is via an iamge, and it's not stylable<br> <tantek> IMO a Unicode checkbox character wouldn't match anything that anyone implements, so that seems like a bad idea<br> <TabAtkins> fantasai: So we could default to text, but the author could then style in more things.<br> <TabAtkins> fantasai: It would be easy to adjust that.<br> <TabAtkins> gregwhitworth: Only stuff you could do with text<br> <nicole> +1 for having multiple ways of creating the glyph e.g. svg, font, image (but it wouldn't be a background image)<br> <tantek> we really shouldn't define things with defaults that are ugly<br> <fantasai> TabAtkins: Still can style using content easily, even if we use default is an SVG<br> <fantasai> TabAtkins: and can do a lot more if the default content is a standardized SVG<br> <TabAtkins> leaverou: And you don't need graphics software, can just write a data URL<br> <TabAtkins> gregwhitworth: and how do you get that checkmark image put together?<br> <tantek> agreed with gregwhitworth, don't make authors completely have to redefine a checkbox in order to tweak its styling<br> <TabAtkins> gregwhitworth: Without reaching for graphics software, can't adjust padding or sizing, can't add drop shadows, etc<br> <TabAtkins> leaverou: I thought with "appearance:base" you could just set all those properties<br> <TabAtkins> gregwhitworth: You can, but SVG still offers more power in graphical means<br> <jensimmons> q+<br> <TabAtkins> gregwhitworth: And I'm also trying to set up the convo for the range pseudo in the next convo, and they'll ahve more complex needs that wouldn't be handleable via text<br> <nicole> q+<br> <leaverou> q+<br> <TabAtkins> fantasai: wrt appearance:base, you were hinting in October, glad to see this<br> <tantek> No browsers's current checkboxes look like Unicode checkbox characters, seems like a hack to try to shoehorn like that or to explore that<br> <TabAtkins> fantasai: agree with premise. concern with doing it *right now* is that before we ship it, we'll need a structure for every html element<br> <astearns> ack fantasai<br> <TabAtkins> fantasai: If we ship for checkbox/radio and haven't figured out the other inputs, we'll have compat problems when we alter try to ship it for other inputs<br> <leaverou> +1 to what fantasai just said<br> <TabAtkins> gregwhitworth: what compat problems?<br> <tantek> +1 to what fantasai said, e.g. range control<br> <dholbert> (in particular if someone styles using `input {...}` as their selector, I imagine)<br> <TabAtkins> fantasai: If there's an effect on checkbox, but not *currently* on selects/files/etc, then people will apply the property too widely and it'll just do nothing so they won't notice; later when we define effects it'll change the page<br> <TabAtkins> gregwhitworth: It'll take a very long time to get all those structures in place...<br> <fantasai> TabAtkins: You're missing fantasa's point. Right now, it doesn't do anything on file input, people will apply it to all inputs to get the effect they want<br> <tantek> +1 good summary TabAtkins<br> <fantasai> TabAtkins: and then if you make it have an effect later, then that'll break pages<br> <astearns> q?<br> <fantasai> gregwhitworth: I would like to figure out how to do that in less than 10 years<br> <fantasai> TabAtkins: You could have different keywords per input type<br> <fantasai> TabAtkins: e.g. base-checkbox<br> <fantasai> TabAtkins: A little more awkward to use...<br> <fantasai> gregwhitworth: but maybe 10yrs later we can have just 'base'<br> <TabAtkins> fantasai: Another thing: naming it ::checked-indicator would make it clearer, ::indicator is super generic<br> <leaverou> Or just embrace the generic-ness and call it ::marker :))<br> <TabAtkins> gregwhitworth: I purposely didn't do the openui agenda for naming; we resolved on "indicator" there bc it's the generic word across component libraries<br> <tantek> +1 fantasai agreed, "indicator" sounds too generic, unless we actually define what it means for all controls that have "indicators", e.g. the disclosure triangle from summary/details!<br> <TabAtkins> fantasai: Sure, no problem with "indicator" itself, just that *by itself* it's not clear what it refers to<br> <TabAtkins> fantasai: Another topic: 'content' should apply so we can swap out for text or other images<br> <TabAtkins> fantasai: If you want the default contents to be a particular SVG, sure; but 'content' should still apply<br> <TabAtkins> gregwhitworth: Oh yeah sure, please open an issue for this<br> <TabAtkins> gregwhitworth: I like the idea of not having `[type=checkbox]::checkmark-indicator`<br> <leaverou> -1 to ::checked-indicator, as greg pointed out it would end up being too generic<br> <fantasai> ::checked<br> <fantasai> ::checked-indicator<br> <brandon> wouldn't ::indicator be targeted by the elements state? e.g. checked, indeterminate? which then makes its specific?<br> <leaverou> s/too generic/too repetitive/<br> <TabAtkins> fantasai: ::checked-indicator to match :checked<br> <TabAtkins> gregwhitworth: You'll be applying this alongside selector that already targets the element, so it should be obvious from the fuller selector context that this is a checkbox indicator<br> <Rossen_> q?<br> <TabAtkins> florian: I'm unsure how this - i like appearnce:base<br> <Rossen_> ack florian<br> <TabAtkins> florian: Unsur ehow styling works in UA stylesheet<br> <emilio> hah, was going to mention just this<br> <TabAtkins> florian: Can't select off of the property value<br> <TabAtkins> florian: But the UA probably does want to style appropriately based on the base value<br> <tantek> semi-agreed with florian, please don't overload 'appearance'<br> <TabAtkins> florian: So probably want some magic in the UA stylesheet for this<br> <Rossen_> q?<br> <emilio> actually, on checkboxes border doesn't suppress appearance<br> <TabAtkins> gregwhitworth: Yeah wehn I discussed with TabAtkins earlier we realized that magic would be necessary.<br> <tantek> q?<br> <fantasai> TabAtkins: It's a UA stylesheet in the shadow<br> <fantasai> florian: It's not just the parts inside that you're styling, but the checkbox element itself<br> <fantasai> fantasai: You can select the host element from shadow<br> <TabAtkins> florian: For existing checkbox/radio button, wonder if we could get away with ::before in that magic stylesheet<br> <TabAtkins> florian: I think if we were defaulting to unicode for checkbox, we could use ::before; if you want to default to an SVG that wouldn't fly...<br> <TabAtkins> florian: Anothe rpoint<br> <gregwhitworth> btw, here's a non-production web component that shows this: https://codepen.io/gregwhitworth/project/editor/754e0097edc1dd2e17617a36fed89d06<br> <TabAtkins> florian: For the controls that are reasonably stylable with appearance:none, people have styled them<br> <TabAtkins> florian: For the ones that are complex enough that "none" is unusable bc too much structure is needed, maybe we could define that "none" is the same as "base". Like for range controls<br> <TabAtkins> gregwhitworth: Yeah I was going to piggyback on "none" ages ago<br> <TabAtkins> florian: Also, +1 to tab's idea of specialized keywords<br> <Rossen_> ack emilio<br> <TabAtkins> emilio: Was gonna mention some of Florian's point, namely tweaking UA stylesheet is annoying<br> <TabAtkins> emilio: Right now, checkbox and radios are trickier than most, because appearance:none changes the box itself - it'll start respecting the display value, for example<br> <TabAtkins> emilio: For most controls we can explain it as shadow DOM<br> <TabAtkins> emilio: So Gecko has the ability to create elements at layout time; webkit/blink can't do that, they have the shadow present immediately and change the styling<br> <faceless2> present-<br> <TabAtkins> emilio: So it would be tricky, but overall this seems sane<br> <TabAtkins> emilio: Also right now, no browser creates a bunch of elements for checkboxes/radios, so if you have thousands that gain "base" it could slow things down<br> <TabAtkins> emilio: Right now they're just a single elemnt with a paint-time rendering<br> <TabAtkins> emilio: The shadow dom-in-stylesheet thing only works if the shadow dom is not there with appearance:auto<br> <TabAtkins> emilio: I think gecko can do it, but other browsers maybe not. IMplementability is tricky.<br> <TabAtkins> emilio: Borders in particular don't have florian's issue - nothing suppresses auto appearance for checkboxes<br> <astearns> ack jensimmons<br> <TabAtkins> jensimmons: I don't feel comfortable resolving on this yet<br> <Rossen_> ack jensimmons<br> <TabAtkins> jensimmons: I'm not sure what's actually bieng proposed yet - there was no code examples in the slides, ther'es no explainer...<br> <TabAtkins> jensimmons: Not even deatils needed, just big-picture of what are we doing, what's the plan for the future...<br> <fantasai> gregwhitworth, just send an attachment to www-archive@w3.org<br> <TabAtkins> gregwhitworth: I think those are all answere din the explainer, which I just can't expose publicly quite yet<br> <TabAtkins> Rossen_: Very valid feedback - getting the explainer out ahead of the discussion would have answered these questions<br> <TabAtkins> gregwhitworth: So inverting, would someone be against me writing a PR as we reveal the explainer, etc?<br> <TabAtkins> Rossen_: There's a lot more details than just PR - you'll go thru a TAG review, etc. It'll speed up once you get an explainer out.<br> <tantek> +1 to a much more clear / expanded explainer, rather than spec text<br> <Rossen_> ack nicole<br> <TabAtkins> nicole: I think this is a problem worth solving.<br> <TabAtkins> nicole: We did some looking around how appearance:none is currently used<br> <TabAtkins> nicole: We foudn another compat problem - people applied props that *only* work when appearance:none is on, but don't set appearance:none so those props dont' do anything<br> <TabAtkins> nicole: So they get backwards non-compat accidentally<br> <tantek> +1 nicole, use of appearance is confusing already, and I'd take that a step further: OpenUI should (must?) not use 'appearance' for any aspect of its design<br> <TabAtkins> Rossen_: Are youa skign about a fallback mechanism?<br> <TabAtkins> nicole: No, this feature triggers many things working, but if people use this now without (accidentally) turning this on, it makes things hard to change in the future<br> <TabAtkins> nicole: So if they set, say, height on it, which only works with appearnce:none, then that makes it hard for us to ever make 'height' work on default appearance for those elements<br> <gregwhitworth> Explainer: https://github.com/salesforce/standards-explainers/blob/master/indicator-psuedo/explainer.md<br> <TabAtkins> fantasai: But that doesn't happen unless you set appearance<br> <gregwhitworth> yay, it went public just in time :)<br> <Rossen_> q<br> <Rossen_> ack leaverou<br> <TabAtkins> nicole: Right, this was building on the earlier talk about this making it hard to ship "base" for othe relements in the future<br> <TabAtkins> leaverou: ABout where :indicator points<br> <TabAtkins> leaverou: If it points to the SVG, you can set storke/fill on the svg and those inherit<br> <TabAtkins> leaverou: Anothe rpoint, not sure about base-checkbox/base-radio, seems ocnfusing that you can apply them to othe rprops and they don't work<br> <TabAtkins> gregwhitworth: I already proposed that ::indicator is on the SVG<br> <TabAtkins> leaverou: Oh, ok<br> <tantek> +1 leaverou yes 'appearance' is a complete mess (again, I'm sorry). please stop attempting to expand it.<br> <Rossen_> ack fantasai<br> <TabAtkins> leaverou: Woudl also be good to have slides posted<br> <tantek> (I'm not queuing because leaverou already made the points I wanted to make)<br> <Rossen_> ack tantek<br> <Rossen_> ack TabAtkins<br> <fantasai> TabAtkins: need to point to path as well, because some properties don't inherit, like the path<br> <fantasai> TabAtkins: Most things can go onto svg, no problem<br> <fantasai> TabAtkins: Wrt base-checkbox etc. Reason those were weird and bad for appearance is because they were defined as "make this element look like this other thing" on any element<br> <fantasai> TabAtkins: They were supposed to do something, didn't, and wasn't clear what they were supposed to do at all<br> <gregwhitworth> https://www.irccloud.com/pastebin/S1etVZTK/<br> <gregwhitworth> jensimmons: ^<br> <fantasai> TabAtkins: The new values would only work on the matching elements, and would be well-defined what it does<br> <florian> q+<br> <fantasai> TabAtkins: doesn't have any effect on other things, will be interoperable<br> <fantasai> TabAtkins: doesn't have same problems as the previous appearance values<br> <fantasai> leaverou: Wrt SVG path, can just replace the SVG<br> <fantasai> TabAtkins: Then can't style it<br> <TabAtkins> florian: Also: the appearnace list had all the control *parts*, which made the property's list enormous, and different brwosers had different anatomies so their lists were different...<br> <Rossen_> ack florian<br> <TabAtkins> florian: Not trying to reproduce that, so this would be more manageable.<br> <TabAtkins> Rossen_: So wrapping up, Greg has dropped an explainer link.<br> <tantek> (aside: correction: appearance didn't have the control *parts* but rather had a hierarchy of types of controls, I can see how that could be confusing though)<br> <TabAtkins> Rossen_: It feels like people in the group want to be able to read the explainer before resolving on anything. Can you bring it back next week's call after people have a chance to read?<br> <TabAtkins> gregwhitworth: Yes, and please file issues as you find things.<br> <TabAtkins> <br dur=10min><br> <TabAtkins> emilio, it would still work to have the SVG always inside the checkbox but display:none'd by default, right?<br> <TabAtkins> it woudl increase the weight of the elements, which you reaised as a separate concern<br> <tantek> FYI: original 'appearance' definition in case anyone wants the sordid history: https://www.w3.org/TR/2002/WD-css3-ui-20020802/#appearance<br> <TabAtkins> tantek: If you consider 'appearance' poisoned, nothing particularly wrong with minting a new property here, it's just that 'appearance' *already* has the right semantics.<br> <emilio> TabAtkins: hmmm, you mean with `appearance: none`? Having something like a shadow dom with the hidden svg could work I suspect, yeah<br> <TabAtkins> emilio: Dunno quite what you mean wrt appearance:none here, but probably, yes.<br> <emilio> TabAtkins: yeah, I meant that it wouldn't affect current uses of appearance: none<br> <TabAtkins> emilio: Then yes, definitely.<br> <TabAtkins> Also: I'm out for the day so kitty can go to the vet. See y'all Thursday!<br> <myles> ScribeNick: myles<br> </details> -- GitHub Notification of comment by css-meeting-bot Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5914#issuecomment-776104777 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 9 February 2021 17:25:35 UTC