Skip to content

Instantly share code, notes, and snippets.

@aaronmcadam
Last active August 29, 2015 14:03
Show Gist options
  • Save aaronmcadam/db190388610c70f63c82 to your computer and use it in GitHub Desktop.
Save aaronmcadam/db190388610c70f63c82 to your computer and use it in GitHub Desktop.
Adding hover and active styles with pseudo-elements.
&:hover {
position: relative;
&:before {
content: " ";
height: 24px;
width: 24px;
left: 0;
top: 0;
position: absolute;
background: $header_background_colour;
opacity: 0.3;
}
}
&:active {
position: relative;
&:before {
content: " ";
height: 24px;
width: 24px;
left: 0;
top: 0;
position: absolute;
background: black;
opacity: 0.3;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment