Last active
August 29, 2015 14:22
-
-
Save frontendbeast/606b0e990199c3cd35b7 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
// ---- | |
// libsass (v3.2.4) | |
// ---- | |
.c-nav { | |
position: relative; | |
&:before { | |
content: 'Menu'; | |
display: inline-block; | |
padding: 1rem; | |
// Instead of this: | |
.c-nav:focus &, | |
.c-nav:hover & { | |
background-color: grey; | |
} | |
// Can I do something like this | |
// and get the same output as above | |
@at-root { | |
&:focus &, | |
&:hover & { | |
background-color: grey; | |
} | |
} | |
} | |
// Or is it best to just do it like this | |
&:focus &:before, | |
&:hover &:before { | |
background-color: grey; | |
} | |
} |
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
.c-nav { | |
position: relative; | |
} | |
.c-nav:before { | |
content: 'Menu'; | |
display: inline-block; | |
padding: 1rem; | |
} | |
.c-nav:focus .c-nav:before, | |
.c-nav:hover .c-nav:before { | |
background-color: grey; | |
} | |
.c-nav:before:focus .c-nav:before, | |
.c-nav:before:hover .c-nav:before { | |
background-color: grey; | |
} | |
.c-nav:focus .c-nav:before, | |
.c-nav:hover .c-nav:before { | |
background-color: grey; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment