Skip to content

Instantly share code, notes, and snippets.

@gko
Last active November 5, 2026 19:09
Show Gist options
  • Select an option

  • Save gko/449dc7320875f9836e0407a8f8a3e2c2 to your computer and use it in GitHub Desktop.

Select an option

Save gko/449dc7320875f9836e0407a8f8a3e2c2 to your computer and use it in GitHub Desktop.
burger menu
<div class="Menu">
<div class="Menu-line"></div>
<div class="Menu-line"></div>
</div>
$width: 30px;
$color: rgba(0, 0, 0, 0.5);
$space-between: 10px;
.Menu {
cursor: pointer;
width: $width;
height: $width;
display: flex;
flex-direction: column;
&:hover {
.Menu-line {
display: none;
&:first-of-type {
display: block;
&:after {
top: $width/2;
transform: rotate(45deg);
}
}
&:last-of-type {
display: block;
&:after {
top: 0;
transform: rotate(-45deg);
}
}
}
}
&-line {
position: relative;
flex-grow: 1;
display: block;
&:first-of-type {
&:after {
bottom: $space-between/2;
}
}
&:last-of-type {
&:after {
top: $space-between/2;
}
}
&:after {
top: 50%;
position: absolute;
content: " ";
width: 100%;
border-bottom: 1px solid $color;
transition: transform 200ms cubic-bezier(0.4, 0.01, 0.17, 0.99),
top 100ms linear,
bottom 100ms linear;
}
}
}
@zakinalvix

zakinalvix commented Nov 5, 2026 •

Copy link
Copy Markdown

I like this simple burger menu design, especially how the two lines smoothly transform into a close icon when hovered over. The SCSS is well organized, and using transitions makes the interaction feel clean and responsive. Small details like this can make a big difference in website navigation and overall user experience. A well-designed menu also helps visitors find useful information quickly, whether they are exploring a website or checking restaurant options. For example, the https://texasroadhouseemenu.com/ makes it easier for visitors to explore different food categories, popular meals, and prices before deciding what to order. Thanks for sharing this useful code example!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment