Intent to prototype & ship: extended :lang() attribute matching (CSS Selectors 4)

Skip to first unread message

Jonathan Kew

Apr 8, 2023, 9:10:38 AM4/8/23
Intent to Prototype:

Summary: The CSS Selectors Level 4 spec enhances the CSS :lang()
pseudo-class to provide authors with more flexible matching behavior,
based on BCP47 "Tags for Identifying Languages" and RFC4647 "Matching of
Language Tags".

For example, it becomes possible to use a selector such as :lang("*-CH")
to match content tagged as any language with a Swiss region subtag,
instead of having to write separate selectors for each of de-CH, fr-CH,
it-CH, etc.



Standards Body: CSS Working Group

Platform coverage: All platforms/contexts

Preference: Not planning to put this behind a pref; it will simply be an
enhancement of the capabilities of an existing feature.

DevTools bug: n/a

Link to standards-positions discussion:

Other browsers:

Blink: Intent to Ship:

WebKit: Shipped (since around 2015, I believe), though I have noted some
spec-conformance issues with their implementation.

web-platform-tests: Proposing to add some WPT tests in the Gecko bug;
Blink implementers are also working on adding tests.

- - - - - - - - - -

Intent to Ship:

As of Firefox 114 (if all goes well), I intend to turn CSS Selectors 4
:lang() matching on by default for all platforms. I expect this to land
directly without being gated on a preference.

Status in other browsers is WebKit: shipping; Blink: Intent to Ship (see

Bug to turn on by default:
Reply all
Reply to author
0 new messages