Created
June 18, 2014 14:24
-
-
Save AllThingsSmitty/5a6953739c2cfd03dd3c to your computer and use it in GitHub Desktop.
Very simple and pragmatic mixin for applying hover and active states in one go
This file contains hidden or 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
// When we give an element some 'attention' | |
@mixin attention() { | |
&:hover, | |
&:active, | |
&:focus { | |
@content; | |
} | |
} | |
a { | |
font-weight: bold; | |
text-decoration: none; | |
color: #c00; | |
@include attention() { | |
outline: none; | |
color: #09f; | |
} | |
} | |
.btn { | |
background-color: #09f; | |
@include attention() { | |
background-color: darken(#09f, 10%); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment