Skip to content

Instantly share code, notes, and snippets.

@idflood
Last active August 29, 2015 14:26
Show Gist options
  • Save idflood/69ff87dd5ef2891349b4 to your computer and use it in GitHub Desktop.
Save idflood/69ff87dd5ef2891349b4 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
@mixin hover() {
@if ($current_block != false) {
#{$current_block}:hover & {
@content;
}
}
@else {
@warn "Hover mixin called outside of a block";
}
}
@mixin element($element) {
$current_block: #{&} !global;
&__#{$element} {
@content;
}
// Step out of the current module.
$current_block: false !global;
}
.story-box {
@include element(header) {
font-weight: 500;
@include hover() {
text-decoration: underline;
}
}
}
.story-box__header {
font-weight: 500;
}
.story-box:hover .story-box__header {
text-decoration: underline;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment