JSFiddle - React, Tailwind, and code Playground

by luka kupunia

HTML

<div id="burger">
  <span></span>
  <span></span>
  <span></span>
</div>

CSS

#burger {
    margin: 0 20px;
    height: 28px;
    width: 40px;
    position: relative;
    margin-top: 3px;
    cursor: pointer;
}

#burger span {
    display: block;
    position: absolute;
    right: 0;
    border-radius: 12px;
    height: 6px;
    background: #4D4E54;
    transform-origin: right;
    transform: scaleX(0);
    transition: 1s;
}
 #burger span {
    background: #EBEBEB;
}
#burger span {
    transform: scaleX(1);
}
#burger span {
    background: #4D4E54 !important;
}

#burger span:nth-child(1) {
    width: 100%;
    top: 0;
}

#burger span:nth-child(2) {
    width: 100%;
    top: 11px;
    transition-delay: 0.1s;
}

#burger span:nth-child(3) {
    width: 27px;
    bottom: 0;
    transition-delay: 0.2s;
}