@import "variables";

.vn-toggle {
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    outline: none;

    & > span {
        font-size: 1rem;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
    }
    & > .btn {
        position: relative;
        box-sizing: border-box;
        display: inline-block;
        vertical-align: middle;
        width: 20px;
        height: 20px;
        min-width: 20px;
        margin: 6px 0;
        margin-right: 9px;
        border: 2px solid #666;
    }
    & > .btn > .focus-mark {
        position: absolute;
        top: 50%;
        left: 50%;
        height: 38px;
        width: 38px;
        margin-top: -19px;
        margin-left: -19px;
        border-radius: 50%;
        transform: scale3d(0, 0, 0);
        transition: background 250ms;
        transition: transform 250ms;
        background-color: rgba(0, 0, 0, .1);
    }
    &.checked > .btn {
        border-color: $color-button;

        & > .focus-mark {
            background-color: rgba($color-button, .15);
        }
    }
    &.disabled {
        cursor: inherit;

        &.checked > .btn {
            border-color: $color-font-secondary;
        }
    }
    &.readonly {
        cursor: inherit;
    }
    &:focus:not(.disabled) > .btn > .focus-mark {
        transform: scale3d(1, 1, 1);
    }
}