-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Nice to have &&
references parent's parent
#1790
Comments
Apparently I misunderstood what
would compile to:
instead of the current:
|
Sass already offers the ability to do what you're asking. .Block {
$p: &;
&-element { /* */ }
&--modifier {
#{$p}-element { /* */ }
}
} Understanding the Your second suggestion makes absolutely no sense and would be a backwards incompatible change for users who already use the parent selector in its current form. |
Thank you! Glad to know there's a way.
compiling to:
|
That issue has already been raised (see: #1424) |
@cimmanon the only thing about that method is that if you use more than one selector (Ex |
I'm writing code where I want to store a component's state as a bem modifier on the container. Right now I can't use the new
&--...
nested with&-...
to do so. Therefore I propose to add a double ampersand to reference the parent's parent, and perhaps&(n)
to continue upward traversal.Example:
would compile to
The text was updated successfully, but these errors were encountered: