-
Notifications
You must be signed in to change notification settings - Fork 707
[css-forms-1] Standardize mechanism for styling <meter>
based on value
#11336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Turns out we also need to actually standardise the algorithm for determining how optimal a value is because Firefox and Chromium seem to disagree. See whatwg/html#3520 for details. |
<meter>
based on value<meter>
based on value
Based on discussions in OpenUI and during one of the joint task force calls I think we're in agreement these states should be reflected via pseudo classes rather than pseudo elements (aka Firefox approach not WebKit/Chrome approach). The question then becomes what names to use. |
https://drafts.csswg.org/css-forms/#targeting-different-meter-states-the-low-value-high-value-optimal-value-pseudo-classes - I don't think these pseudo-classes in their current form can be used to replicate the existing states of a The algorithms between Firefox and WebKit/Blink are subtely different but I'll try to explain what the algorithm for three possible pseudo classes could look like (based on Firefox):
it's possible that a |
I also worry that |
FYI, a bit more discussion here: openui/open-ui#1130 |
In CSS Forms we have a shape for the elements of a meter:
However, for this to be useful for styling we need some way to style based on how optimal the value of the meter element is.
WebKit (and blink) uses different pseudo elements instead of a single
:slider-fill
equivalent and their naming is::-webkit-meter-even-less-good-value
,::-webkit-meter-suboptimum-value
and::-webkit-meter-optimum-value
.Firefox has a single
::-moz-meter-bar
pseudo element and instead applies pseudo classes to<meter>
these are:-moz-meter-sub-sub-optimum
,:-moz-meter-sub-optimum
and:-moz-meter-optimum
.Using pseudo classes seems the better approach between the two. I suspect we can drop the meter prefix and just go with something like
:sub-sub-optimum
,:sub-optimum
,:optimum
? But naming would need bikeshedding as neither Firefox's nor WebKit's seem great.The text was updated successfully, but these errors were encountered: