.nav-icon { width: 35px; height: 30px; position: relative; cursor: pointer; transform: rotate(0deg); transition-duration: 0.5s; transition-timing-function: ease-in-out; span { display: block; position: absolute; height: 6px; width: 100%; background: $color__link; border-radius: 6px; opacity: 1; left: 0; transform: rotate(0deg); transition-duration: 0.25s; transition-timing-function: ease-in-out; &:nth-child(1) { top: 0px; } &:nth-child(2), &:nth-child(3) { top: 12px; } &:nth-child(4) { top: 24px; } } &.open { span { &:nth-child(1) { top: 12px; width: 0%; left: 50%; } &:nth-child(2) { transform: rotate(45deg); } &:nth-child(3) { transform: rotate(-45deg); } &:nth-child(4) { top: 12px; width: 0%; left: 50%; } } } }