Skip to content

Instantly share code, notes, and snippets.

@encrypticus
Created September 11, 2019 09:46
Show Gist options
  • Select an option

  • Save encrypticus/93b1aee4ce39ea5a37c2e0bf2fd17fc2 to your computer and use it in GitHub Desktop.

Select an option

Save encrypticus/93b1aee4ce39ea5a37c2e0bf2fd17fc2 to your computer and use it in GitHub Desktop.
burger menu on scss
.burger {
display: none;
width: 30px;
padding: 0;
line-height: 30px;
border: 0;
cursor: pointer;
background-color: transparent;
order: 0;
margin-left: auto;
@include for-tablet-landscape-down() {
display: inline-block;
margin-right: 5%;
}
> span {
position: relative;
display: inline-block;
width: 100%;
height: 3px;
font-size: 0;
vertical-align: middle;
background-color: $black;
transition: background .3s;
&:before,
&:after {
content: '';
position: absolute;
left: 0;
width: 100%;
height: 100%;
background-color: $black;
transition: top .3s .3s, transform .3s;
}
&:before {
top: -10px;
}
&:after {
top: 10px;
}
}
&_close {
> span {
background-color: transparent;
&::before,
&::after {
top: 0;
transition: transform .3s .3s, top .3s;
}
&::before {
transform: rotate(45deg);
}
&::after {
transform: rotate(-45deg);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment