[csswg-drafts] [css-selectors] add numeric comparisons on attribute values (#5890)

liamquin has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-selectors] add numeric comparisons on attribute values ==
Can we have numeric comparisons?

e.g.
[data-balance<0] { color: red; } (common in accounting/finance, along with putting ( ) around the value)
[data-eyes>7.9] { color: black; background-colour: yellow } /* spider! */

with < <= >  >=

Noting that testing for equality is string equality so testing 06=6 fails, an alternative design might be to calc() to fetch an attribute value, and to be allowed in selectors, but that's more complex.

Maybe a new section inhttps://drafts.csswg.org/selectors/#attribute-selectors for Numeric Attribute Values?

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5890 using your GitHub account


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

Received on Monday, 25 January 2021 00:57:00 UTC