Skip to content

[css-selectors-5] add :heading, :heading(An+B) pseudo classes #11836

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

Merged
merged 1 commit into from
Jun 27, 2025

Conversation

keithamus
Copy link
Member

This fixes #10296, #351, #1008 by specifying the :heading and :heading(An+B) pseudo classes, which will match against elements with a defined heading level. As it stands, the current elements with a heading level are h1, h2, h3, h4, h5, and h6.

There is a proposal being actively prototyped to allow for more dynamic heading levels that do not strictly adhere to their tagname (see whatwg/html#5033 for more). This proposal (adding the headingoffset, headingreset attributes) will make it significantly more complex to unilaterally style elements with a heading level of, say, 1, raising the importance of the selectors proposed in this PR.

I've Agenda+ the issue #10296 in order to discuss this, the proposed selectors, that we may resolve and merge this PR, but in the meantime I would appreciate editorial review from those that have time.

@keithamus keithamus requested a review from tabatkins March 5, 2025 18:14
@keithamus keithamus changed the title [css-selectors-5] add :heading, :heading() pseudo classes Mar 5, 2025
@keithamus keithamus merged commit 4c4b37a into w3c:main Jun 27, 2025
1 check passed
@keithamus keithamus deleted the add-heading-heading-pseudo-classes branch June 27, 2025 08:29
@annevk
Copy link
Member

annevk commented Jun 27, 2025

This should really have had a corresponding HTML PR. Will one be created?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants