.toggle {
    border-radius: 6px;
    box-shadow: 0 0 1em rgba(0, 0, 0, .2) inset;
    cursor: pointer;
    display: inline-block;
    font-size: 1rem;
    height: 2rem;
    line-height: 2rem;
    position: relative;
    text-align: center;
    width: 4rem;
}

.toggle.icon::before,
.toggle::after {
    border-radius: inherit;
    content: attr(data-icon-btn);
    height: inherit;
    left: 0;
    position: absolute;
    padding: 0;
    top: 0;
    transition: transform .1s;
    transform: translate3d(0, 0, 0);
    width: 50%;
}

.toggle::after {
    background: white;
}

.toggle:not(.on)::before,
.toggle.on:after {
    content: attr(data-icon);
    transform: translate3d(100%, 0, 0);
}
