.lines-button { position: relative; width: 20px; height: 2px; border-radius: 5px; background: currentColor; &:before, &:after { position: absolute; content: ''; width: inherit; height: inherit; border-radius: inherit; background: currentColor; transform-origin: 50% 50%; } &:before { transform: translate3d(0, -6px, 0); } &:after { transform: translate3d(0, 6px, 0); } // closed state &.close { background: transparent; &:before { transform: rotate3d(0, 0, 1, 45deg); } &:after { transform: rotate3d(0, 0, 1, -45deg); } } }