<div class="menu"></div>
<div class="close"></div>
<div class="menu-round"></div>
<div class="close-round"></div>
.menu {
width: 150px; /* control the size */
aspect-ratio: 1;
background: linear-gradient(#000 50%, #0000 0) 0 0/100% 40%;
}
.close {
width: 150px; /* size of the icon */
aspect-ratio: 1;
background:
conic-gradient(from 90deg at 33% 33%, #0000 90deg, #000 0)
100% 100%/60% 60%;
transform: translateZ(0px) rotate(45deg);
}
.menu-round {
width: 150px; /* update this to control the size */
aspect-ratio: 1;
background:
radial-gradient(closest-side at 12.5% 25%,#000 96%,#0000) 0 0/80% 40%,
linear-gradient(#000 50%,#0000 0) top/80% 40% repeat-y;
}
.close-round {
--s: 150px; /* size */
width: var(--s);
aspect-ratio: 1;
padding: calc(var(--s)*.1);
box-sizing: border-box;
background:
radial-gradient(closest-side at 50% 12.5%,#000 96%,#0000) top /20% 80% repeat-y,
radial-gradient(closest-side at 12.5% 50%,#000 96%,#0000) left/80% 20% repeat-x,
conic-gradient(from 90deg at 33% 33%, #0000 90deg, #000 0)
100% 100%/60% 60% padding-box content-box;
transform: translateZ(0) rotate(45deg);
}
body {
min-height: 100vh;
margin: 0;
display: grid;
grid-auto-flow: column;
place-content: center;
gap: 20px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.