JSFiddle - React, Tailwind, and code Playground
бургер / крестик CSS
by Ankhena
HTML
<button></button>
CSS
* {
box-sizing: border-box
}
button {
position: relative;
width: 48px;
height: 48px;
padding: 0;
background: linear-gradient(to right, #FBA9A2, #FB7DA4);
border: 0;
border-radius: 50%;
}
button::before,
button::after {
content: "";
position: absolute;
top: 50%;
left: 50%;
display: inline-block;
width: 24px;
height: 2px;
background-color: #111;
box-shadow: 0 -6px #111, 0 6px #111;
transform: translate(-50%, -50%);
transition: all .1s ease-out;
}
button:hover {}
button:hover::before {
transform: translate(-50%, -50%) rotate(45deg);
box-shadow: none;
}
button:hover::after {
transform: translate(-50%, -50%) rotate(-45deg);
box-shadow: none;
}