Caniuse: Case-sensitive CSS attribute selectors

Created on 5 Jan 2019  Â·  7Comments  Â·  Source: Fyrd/caniuse

Recommending to add data for case-sensitive matching of CSS attribute selectors along with Case-insensitive CSS attribute selectors.

By default, case-sensitivity depends on document language, so in cases (no pun intended) where the document language specifies a case-insensitive attribute, such as ol[type], the case-sensitivity of the CSS attribute selector may be enabled with the s identifier.

In other words, s has the opposite effect of i.

From the CSS Selectors 4 spec:

The attribute selector may include the identifier s before the closing bracket (]); in this case the UA must match the value case-sensitively (if possible) regardless of document language rules.
…
Example 23: The following rule will style lists with type="a" attributes differently than type="A" even though HTML defines the type attribute to be case-insensitive.

[type="a" s] { list-style: lower-alpha; }
[type="A" s] { list-style: upper-alpha; }

This may be merged into #1058 if necessary.

Support data suggestion

Most helpful comment

Available at https://caniuse.com/#feat=mdn-css_selectors_attribute_case_sensitive_modifier

All 7 comments

+1

Later FX prerelease versions have it added so support

+1

+1

https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/66

Implemented the case-sensitive attribute selector modifier (bug 1512386).

needinfo?(@jpmedley): What is Chrome’s status on supporting this?

I can't get s or i to work in Chrome. I'd have to say, not supported.

Available at https://caniuse.com/#feat=mdn-css_selectors_attribute_case_sensitive_modifier

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dnknn picture dnknn  Â·  3Comments

zackarychapple picture zackarychapple  Â·  3Comments

Schweinepriester picture Schweinepriester  Â·  3Comments

rowbot-weisguy picture rowbot-weisguy  Â·  3Comments

bappygolder picture bappygolder  Â·  3Comments