Skip to content

Instantly share code, notes, and snippets.

@bionicbrian
Last active August 29, 2015 14:26
Show Gist options
  • Save bionicbrian/6da0e080f5237610d6ed to your computer and use it in GitHub Desktop.
Save bionicbrian/6da0e080f5237610d6ed to your computer and use it in GitHub Desktop.
Module SCSS
.y-thingy {
$root: &; // Store it for later use...
background-color: pink;
border: 1px solid purple;
&__content {
margin: {
top: 5px;
bottom: 10px;
}
// The last thingy's content element has margin-bottom 0
#{$root}:last-of-type & {
margin-bottom: 0;
}
}
&__menu {
$menu-name: &; // For later use...
background-color: white;
padding: 5px;
&--is-active {
background-color: pink;
}
&__toolbar {
/* ^ Now two blocks down. But name not unwieldy? */
float: right;
background-color: #999;
#{$menu-name}--is-active & {
background-color: pink;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment