question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rule idea: selector-nest-* (selector type)

See original GitHub issue

Pull 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:open
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kristerkaricommented, Jan 21, 2019

would this relate specifically to chaining or is this tied in with combinators as well?

I was thinking about combinators mainly.

Some of this was implemented as part of #298, perhaps it should not have been? Or was the plan to implement this as exceptions/alternate options?

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 ?

0reactions
kristerkaricommented, Jan 13, 2020

@mdodge-ecgrow Unfortunately there is currently no autofix available for that. 😦

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found