Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SASS Hocus Mixin
// Mixin
@mixin hocus {
&:hover,
&:focus {
@content;
}
}
// Classic SASS
.class {
&:hover,
&:focus {
color:whatever;
}
}
// With mixin
.class {
@include hocus {
color:whatever;
}
}
// Generated
.class:hover,
.class:focus {
color: whatever;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment