Skip to content

Instantly share code, notes, and snippets.

@fabiofidanza
Created October 26, 2020 15:16
Show Gist options
  • Save fabiofidanza/3ce8d99557aa680d18ba6afd3e320a4a to your computer and use it in GitHub Desktop.
Save fabiofidanza/3ce8d99557aa680d18ba6afd3e320a4a to your computer and use it in GitHub Desktop.
CSS only no extra element burger
/* hamburger */
&:after, &:before {
content: "";
position: absolute;
right: 0;
top: 50%;
width: $menuUnit * 6;
background: $white;
height: $menuUnit;
transform-origin: 50% 50%;
transform: translateY(-50%);
transition: all 0.2s ease;
}
&:before {
box-shadow: 0 (-$menuUnit * 2) 0 0 $white, 0 ($menuUnit * 2) 0 0 $white;
}
}
.expanded &:after {
transform: translateY(-1px) rotate(-45deg) scaleX(1.3);
}
.expanded &:before {
transform: translateY(-1px) rotate(45deg) scaleX(1.3);;
box-shadow: none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment