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

Relative selectors example shows invalid code #33030

Closed
eyaler opened this issue Apr 10, 2024 · 1 comment · Fixed by #34045
Closed

Relative selectors example shows invalid code #33030

eyaler opened this issue Apr 10, 2024 · 1 comment · Fixed by #34045
Labels
Content:CSS Cascading Style Sheets docs help wanted If you know something about this topic, we would love your help!

Comments

@eyaler
Copy link
Contributor

eyaler commented Apr 10, 2024

MDN URL

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

What specific section or headline is this issue about?

standalone relative selectors

What information was incorrect, unhelpful, or incomplete?

+ div#topic > #reference {
}

> .icon {
}

What did you expect to see?

An explanation

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

i could not find any explanation. this blog seems to claim that the syntax means an implied :has
https://juejin.cn/post/7278512641781973027, however afaict the grammar requires a selector as the first element

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@eyaler eyaler added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Apr 10, 2024
@github-actions github-actions bot added the Content:CSS Cascading Style Sheets docs label Apr 10, 2024
@Josh-Cena
Copy link
Member

The problem here is that relative selectors cannot be used for a rule. They are only permitted in certain contexts; see https://www.w3.org/TR/selectors-4/#relative. I think :has() is the only one.

@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 Jun 5, 2024
@Josh-Cena Josh-Cena changed the title unexplained selector syntax starting with a combinator Jun 5, 2024
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!
2 participants