Skip to content
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

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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 [css-selectors-5] add :heading, :heading(An+B) pseudo classes Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[selectors] Adding a :heading() selector for headingoffset?
1 participant