Skip to content

Instantly share code, notes, and snippets.

@frontendbeast
Last active August 29, 2015 14:22
Show Gist options
  • Save frontendbeast/606b0e990199c3cd35b7 to your computer and use it in GitHub Desktop.
Save frontendbeast/606b0e990199c3cd35b7 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// 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;
}
}
.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