JSFiddle - React, Tailwind, and code Playground
by cchana
HTML
<div class="menu-icon"></div>
CSS
.menu-icon{
height: 32px;
position: relative;
width: 32px;
}
.menu-icon:before, .menu-icon:after {
transition: all 0.5s;
}
.menu-icon:before {
border: 3px solid #000;
border-radius: 3px;
content: '';
display: block;
height: 0;
position: absolute;
top: 3px;
width: 32px;
}
.menu-icon:after {
border: 3px solid #000;
border-radius: 3px;
bottom: 3px;
content: '';
display: block;
height: 0;
position: absolute;
width: 32px;
}
.menu-icon:hover:before {
top: 13px;
transform: rotate(225deg);
}
.menu-icon:hover:after {
bottom: 13px;
transform: rotate(-225deg);
}