Skip to content

Instantly share code, notes, and snippets.

@greyscaled
Created August 10, 2018 01:48
Show Gist options
  • Save greyscaled/0664d95473b56e85e46b0f306cecb8a2 to your computer and use it in GitHub Desktop.
Save greyscaled/0664d95473b56e85e46b0f306cecb8a2 to your computer and use it in GitHub Desktop.
.navigation {
// ...
&__hamburger {
margin-top: 2rem; // middle line 'meat' of burger
position: relative;
// this sets the style for all 3 lines
&,
&::before,
&::after {
// same hamburger-box width
width: 4rem;
height: 2px;
// make sure each is its own line
display: block;
background-color: #FFF;
}
// set content so they actually render
// set to absolute so we can position relative to middle line
&::before,
&::after {
content: "";
position: absolute;
}
// position each line relative to middle
&::before { top: -2rem; }
&::after { top: 2rem; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment