[css-selectors] Nearest descendant selector
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- PR merge metrics
- PR metrics pending
Description
Hello, I would like to have a selector for the closest child only, which isn't a direct descendant of the container. It is useful for a carousel with a child (e.g. holding controls) and nested carousels, which shouldn't inherit the styles of the topmost one, while allowing for extra wrappers or supporting cases where we don't fully control the HTML structure.
.wrapper ^ .child to select only the first .child:
<div class="wrapper">
<div>
<div class="child"> </div>
</div>
<div>
<div>
<div class="child"> </div>
</div>
</div>
</div>
This has been requested by others before on SO. Thanks.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository file, test, or entry point is named. Start by reading the selector examples and the 13-comment thread, then review the relevant CSS Selectors specification context. Done means an agreed selector syntax with defined behavior for the nested examples shown.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100