-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
Add flattenNestedSelector
#1267
Add flattenNestedSelector
#1267
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM! I think I'd go with either combine or flatten maybe?
I like |
Hi, I love this work! 😄 For naming. The CSS Nesting spec uses "desugar" for
|
Yup, that is confusing, and also why I am looking for a better name :) |
I see. For now, +1 |
Other options that come to mind for me (not necessarily better than
|
Thank you everyone for the feedback 🙇 |
See : stylelint/stylelint#6234
Stylelint has a bunch of rules which analyse selectors in a more analytical and less functional way.
For these rules it isn't relevant that the final selector is valid, or an equivalent.
It is much more important that it contains the right parts and the correct number of duplications. Just wrapping everything with
:is()
does not work there.Name needs bikeshedding.
I want this to communicate that the outcome is the combination of the current and parent selector by using
&
as insertion points.While at the same time making it clear that the result is not valid or equivalent.
Maybe :
glueNestedSelector
insertParentSelector
combineNestedSelector