[css-contain-3] Nesting Context (side effect / enhancement)
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- PR merge metrics
- PR metrics pending
Description
Based on the current implementation in Chrome Canary and Safari TP Container Queries seems to only need a property name – allowing them to be used to expose nesting context.
/* this works */
.container-a {
container-name: A;
container-type: inline-size;
}
@container A (inline-size) {
.child { color: orange; }
}
IMO it makes a lot of sense to use Container Queries to handle this scenario (child styling without a direct reference to the container selector(s)).
If possible it would be nice if container-name could be used without having to specify container-type and query
/* simplified syntax (suggestion) */
.container-a {
container-name: A;
}
@container A {
.child { color: orange; }
}
I hope it makes sense and that I haven't overlooked existing issues
Thank you for your hard work – it is highly appreciated
😃
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
Start with the issue's container-name and @container examples and compare them with the current CSS Containment Level 3 draft and the linked CodePen. Determine whether property-only container names and a query without a condition should be supported; done requires a resolved specification direction and corresponding draft changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100