Created
December 4, 2013 10:41
-
-
Save cahnory/7785578 to your computer and use it in GitHub Desktop.
Split rule by selectors
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
@mixin split($selectors...) { | |
@each $selector in $selectors { | |
#{$selector} { | |
@content; | |
} | |
} | |
} |
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
p { | |
background: #00F; | |
} | |
p::selection { | |
background: #F00; | |
color: #FFF; | |
} | |
p::-moz-selection { | |
background: #F00; | |
color: #FFF; | |
} | |
p::-webkit-selection { | |
background: #F00; | |
color: #FFF; | |
} |
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
p { | |
background: #00F; | |
@include split('&::selection','&::-moz-selection','&::-webkit-selection') { | |
background: #F00; | |
color: #FFF; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment