@charset "UTF-8";
@import "./common/var.css";

@component-namespace el {
  @b hide{
    display: none!important;
  }
  @b switch {
    display: inline-block;
    padding: 0;
    background-color: none;
    border: 0;
    position: relative;
    font-size: var(--switch-font-size);
    line-height: var(--switch-height);
    height: var(--switch-height);
    vertical-align: middle;
    outline: none;
    border-radius: 25px;
    @when disabled {
      & .el-switch__core,
      & .el-switch__label {
        cursor: not-allowed;
      }
    }
    &:hover {

     }

    @e label {
      transition: .2s;
      position: absolute;
      size: var(--switch-width) var(--switch-height);
      left: 0;
      top: 0;
      display: inline-block;
      font-size: var(--switch-font-size);
      cursor: pointer;
      user-select: none;
      @m left {
        i {
          left: 6px;
        }
      }
      @m right {
        i {
          right: 6px;
        }
      }
      & * {
        line-height: 1;
        top: 4px;
        position: absolute;
        font-size: var(--switch-font-size);
        display: inline-block;
        color: var(--color-white);
      }
    }

    @e input {
      display: none;
    }

    @e core {
      margin: 0;
      display: block;
      position: relative;
      size: var(--switch-width) var(--switch-height);
      height: 24px;
      /*border: 1px solid var(--switch-off-color);*/
      outline: none;
      border-radius: var(--switch-core-border-radius);
      box-sizing: border-box;
      background: var(--switch-off-color);
      cursor: pointer;
      transition: border-color .3s, background-color .3s;

      & .el-switch__button {
        position: absolute 0 * * 0;
        border-radius: var(--border-radius-circle);
        transition: transform .3s;
        size: var(--switch-button-size);
        background-color: var(--color-white);
        i {
          font-size: 10px;
          line-height: 13px;
          vertical-align: text-top;
        }
      }
    }

    @when checked {
      .el-switch__core {
        border-color: var(--switch-on-color);
        background-color: var(--switch-on-color);
      }
    }

    @when disabled {
      .el-switch__core {
        border-color: var(--switch-disabled-color) !important;
        background: var(--switch-disabled-color) !important;

        & span {
          background-color: var(--switch-disabled-text-color) !important;
        }

        & ~ .el-switch__label * {
          color: var(--switch-disabled-text-color) !important;
        }
      }
    }

    @modifier wide {
      .el-switch__label {
        &.el-switch__label--left {
          span {
            left: 10px;
          }
        }
        &.el-switch__label--right {
          span {
            right: 10px;
          }
        }
      }
    }

    & .label-fade-enter,
    & .label-fade-leave-active {
      opacity: 0;
    }
  }
}
