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

::part() documentation gives the false impression that :last-child and friends are usable on shadow parts #38367

Open
DavidJCobb opened this issue Feb 27, 2025 · 0 comments · May be fixed by #38388
Labels
Content:CSS Cascading Style Sheets docs help wanted If you know something about this topic, we would love your help!

Comments

@DavidJCobb
Copy link
Contributor

MDN URL

https://developer.mozilla.org/en-US/docs/Web/CSS/::part

What specific section or headline is this issue about?

Description

What information was incorrect, unhelpful, or incomplete?

Emphasis mine:

Pseudo-classes (such as ::part(label):hover) can be appended to the ::part() selector, but structural pseudo-classes that match based on tree information (such as :empty), rather than local element information (such as :last-child), cannot be appended.

The :last-child pseudo-class is a tree-structural pseudo-class and therefore cannot be used on ::part(...). To clarify, foo:last-child::part(name) works, but foo::part(name):last-child does not.

What did you expect to see?

There should not have been a parenthetical after "local element information," much less an inaccurate one. The start of the sentence already gives an example of a selector based on local element information (:hover) being usable on a shadow part.

Do you have any supporting links, references, or citations?

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@DavidJCobb DavidJCobb added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Feb 27, 2025
@github-actions github-actions bot added the Content:CSS Cascading Style Sheets docs label Feb 27, 2025
@Josh-Cena Josh-Cena added help wanted If you know something about this topic, we would love your help! and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Feb 28, 2025
@OnkarRuikar OnkarRuikar linked a pull request Mar 1, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:CSS Cascading Style Sheets docs help wanted If you know something about this topic, we would love your help!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants