Last active
March 1, 2024 11:03
-
-
Save pepelsbey/a2bb3f6b44c4a4729dcc to your computer and use it in GitHub Desktop.
Simple “Hocus” Sass @mixin for :hover and :focus pseudos. Makes them easier to write and you’ll never forget to specify both.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin hocus { | |
&:hover, | |
&:focus { | |
@content; | |
} | |
} | |
// Before | |
E { | |
&:hover, | |
&:focus { | |
color:whatever; | |
} | |
} | |
// After | |
E { | |
@include hocus { | |
color:whatever; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Where is button "Like"? :)