Intent to Prototype: :heading & :heading(AnB#) selectors

543 views
Skip to first unread message

Keith Cirkel

unread,
Jun 28, 2025, 12:33:41 PMJun 28
to dev-pl...@mozilla.org
Summary:
  Adds the :heading and :heading(AnB#) selectors

Bug:

Specification:

Standards Body:
  W3C

Platform coverage:
  all.

Preference:
  layout.css.heading-selector.enabled

DevTools bug:
  N/A

Link to standards-positions discussion:
  N/A

Other browsers:
  Blink: No signal.

web-platform-tests:

I intend to implement `:heading`, which will be a pseudo class to match all heading elements (h1-h6), in addition it can take the functional form of `:heading(AnB#)` - where the comma separated list of AnB notations match a specific heading level (for example `:heading(1, 2n)`). 

This will make it easier for developers to style headings using a simpler selector, and will have stronger motivations if headings end up with dynamic levels such as the proposed `headingoffset` attribute (https://github.com/whatwg/html/issues/5033).
Reply all
Reply to author
Forward
0 new messages