Skip to content

Instantly share code, notes, and snippets.

@joecritch
Created May 21, 2014 11:42
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save joecritch/a60f7f09fecf6d86f7e3 to your computer and use it in GitHub Desktop.
Save joecritch/a60f7f09fecf6d86f7e3 to your computer and use it in GitHub Desktop.
BEM SASS trick
.module {
some: stuff;
&__child {
blah: blah;
}
&--modifier {
modify: me;
}
}
@martinklepsch
Copy link

For other people curious how exactly that looks compiled:

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

@joecritch
Copy link
Author

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

@martinklepsch
Copy link

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