Open josepharhar opened 11 months ago
https://github.com/openui/open-ui/issues/863#issuecomment-1760226526 could it be due to the property limitations mentioned here? Or I guess if it's not using the pseudo element potentially not?
Is a marker element a way to solve this and the “checkmark” in the option element like we were talking about today?
something the browser renders if someone doesn’t add it (like the summary element in a details) but if someone does add it, the browser skips adding it and uses that instead?
If this is a bad idea, please disregard
Hmm that's an interesting idea. Could apply the default hide this from accessibility tree behaviour. Would it require an SVG / img (well I guess anything) child or if you just included it on its own would it still use the default Glyph? Could that allow you to position it without needing your own SVG?
could it be due to the property limitations mentioned here?
No, considering that its still ::part(marker)
that I'm using in the prototype.
something the browser renders if someone doesn’t add it (like the summary element in a details) but if someone does add it, the browser skips adding it and uses that instead?
I wanted to just change the color of it at first in which case I didn't want the browser to skip adding stuff, but in the case that I added content
I did want the browser to skip adding it. I'm not sure exactly how this stuff would be implemented.
Should we encourage people to make their own
<button type=selectlist>
in order to customize the marker and consider getting rid of::marker
entirely if it isn't useful?
The more I think about it, the more appealing this sounds to me. I'd like to propose that we remove ::marker
because imo it isn't very useful.
is there really no use case for this element to not be customized? i still see enough instances of rudimentary forms being implemented for internal use, where designers aren't assigned to projects and devs just use standard HTML elements without needing to gussy them up. I don't think it's a good idea to simply do away with the marker for default UA rendering, unless it's replaced with some other means of providing a default UA style for the chevron.
I think that if we replace the svg with a character that looks like the svg, like "⌄", then it would be more customizable. So instead of this:
background-image: -internal-light-dark(url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj5cCiAgPHBhdGggZD0iTTQgNiBMMTAgMTIgTCAxNiA2IiBzdHJva2U9IldpbmRvd1RleHQiIHN0cm9rZS13aWR0aD0iMyIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPlwKPC9zdmc+), url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj5cCiAgPHBhdGggZD0iTTQgNiBMMTAgMTIgTCAxNiA2IiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iMyIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPlwKPC9zdmc+));
we would have this:
content: '⌄'
I think the intention was to remove the marker pseudo but not to remove the default marker right? So the default UI would still look like currently?
The Open UI Community Group just discussed selectlist: customizing the default button's marker is weird
, and agreed to the following:
RESOLVED: Keep ::marker pseudo element in selectlist. Further investigate exact implementation.
I am planning on experimenting with replacing the svg data url with an actual svg element in the user agent shadowroot to see if that it more stylable.
There hasn't been any discussion on this issue for a while, so we're marking it as stale. If you choose to kick off the discussion again, we'll remove the 'stale' label.
Whoops, that comment was meant for issue https://github.com/openui/open-ui/issues/863 I'll move it
I was able to make the default button's marker more customizable in this patch by replacing the background-image data url of the svg to an actual svg element in the dom tree, and setting its color with UA styles which target the pseudo-element. I don't see any reason not to do it this way, so I'm going to go for it.
I was just trying to change the color of the marker in the selectlist's default button, which can be accessed via
::marker
- although I haven't implemented this in the chromium prototype yet, so for now its still::part(marker)
.Setting
color
orcontent
didn't seem to do anything. I even removed thebackground-image
property to get rid of the svg that we currently render in there, but that didn't make thecontent
start showing...This would have been easier to do when we had a slot for the marker to replace it with whatever you want, but if you really want to customize the default marker then you're better of just using your own
<button type=selectlist>
.Should we encourage people to make their own
<button type=selectlist>
in order to customize the marker and consider getting rid of::marker
entirely if it isn't useful? Or should we make::marker
easier to use, perhaps by changing the user-agent styles? I don't feel like it's important enough to make a new<marker>
element to bring us up to par with the slot we used to have, but maybe it is...Here are the styles that we currently have in the marker in the chromium prototype: