Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
BEM SASS trick
.module {
some: stuff;
&__child {
blah: blah;
}
&--modifier {
modify: me;
}
}
@martinklepsch

This comment has been minimized.

Copy link

martinklepsch commented May 21, 2014

For other people curious how exactly that looks compiled:

.module {
  some: stuff;
}
.module__child {
  blah: blah;
}
.module--modifier {
  modify: me;
}
@joecritch

This comment has been minimized.

Copy link
Owner Author

joecritch commented May 21, 2014

Although worth bearing in mind that this apparently only works with Sass 3.3, because of the way '&' is parsed.

@martinklepsch

This comment has been minimized.

Copy link

martinklepsch commented May 26, 2014

Haha, just ran into exactly this issue (unaware of your comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.