Rule idea: selector-nest-* (selector type)
See original GitHub issuePull request #298 implemented the selector-nest-combinators
rule to check that selector combinators are nested.
Based on this list https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors, there could also be these additional rules:
selector-nest-types
selector-nest-classes
selector-nest-ids
selector-nest-attributes
selector-nest-pseudos
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
CSS Nesting Module - W3C
This module introduces the ability to nest one style rule inside another, with the selector of the child rule relative to the selector...
Read more >Native CSS nesting: What you need to know - LogRocket Blog
The @nest rule allows nesting to be more flexible in CSS. So rather than having the nesting selector only at the beginning of...
Read more >selector-nested-pattern · Issue #962 - GitHub
Describe the issue. Is it a bug or a feature request (new rule, new option, etc.)? A new rule to only allow pseudo...
Read more >selector-nested-pattern - Stylelint
Specify a pattern for the selectors of rules nested within rules. Non-standard selectors (e.g. selectors with Sass or Less interpolation) and selectors of...
Read more >CSS Basics: Part 3: Nesting Selectors - YouTube
This video expands on using tag, ID, and CLASS selectors as part of nesting them to find and apply rules to elements.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I was thinking about combinators mainly.
My thinking behind the new rules was that you could limit the nesting by the type of the selector. So if you only care that the classes should be nested, then you could enabled that rule.
Now that I’m thinking about this, maybe it would make more sense to introduce these as options to your rule. What would you think about that @lxsymington ?
@mdodge-ecgrow Unfortunately there is currently no autofix available for that. 😦