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

@component-namespace el {

  @b checkbox {
    color: var(--checkbox-color);
    position: relative;
    cursor: pointer;
    display: inline-block;
    /*white-space: nowrap;*/
    @utils-user-select none;
    line-height:36px;

    @e input {
      /*white-space: nowrap;*/
      cursor: pointer;
      outline: none;
      display: inline-block;
      position: absolute;
    &.is-checked {
        .el-checkbox__inner {
            border-color: transparent;
     }
    }
    & .border::before {

      }
      @when disabled {
        .el-checkbox__inner {
          background-color: var(--checkbox-disabled-input-fill);
          border-color: transparent;
          cursor: not-allowed;

          &::after {
            cursor: not-allowed;
            /*border-color: var(--checkbox-disabled-icon-color);*/
          }

          & + .el-checkbox__label {
            cursor: not-allowed;
          }
        }
        &.is-checked {
          .el-checkbox__inner {
            background-color: var(--color-blue-20);
            border:1px solid transparent;
            &:hover{
                 background-color: var(--color-blue-20);
                 border:1px solid transparent;
             }
            &::after {
              /*border-color: var(--checkbox-disabled-checked-icon-color);*/
            }
          }
        }
        &.is-indeterminate {
          .el-checkbox__inner {
            background-color: var(--checkbox-disabled-checked-input-fill);
            /*border-color: var(--checkbox-disabled-checked-input-border-color);*/

            &::before {
              /*border-color: var(--checkbox-disabled-checked-icon-color);*/
            }
          }
        }
        & + .el-checkbox__label {
          color: var(--disabled-color-base);
          cursor: not-allowed;
        }
      }
      @when checked {
        .el-checkbox__inner {
          background-color: var(--checkbox-checked-input-fill);
          border-color: var(--checkbox-checked-input-border-color);
        &:hover {
          background-color: var(--color-blue-60);
         }
          &::after {
            transform: rotate(45deg) scaleY(1);
          }
        }
      }
      @when focus {
        .el-checkbox__inner {
          /*@mixin focus-shadow;*/
          background-color: var(--color-gray-30);
          border-color: var(--color-gray-40);
          outline: auto;
          outline: auto -webkit-focus-ring-color;
          outline-offset: 4px;
          overflow: hidden;
        }
      }
      @when indeterminate {
        .el-checkbox__inner {
          background-color: var(--checkbox-checked-input-fill);
          /*border-color: var(--checkbox-checked-input-border-color);*/

          &::before {
            content: '';
            position: absolute;
            display: block;
            border: 1px solid var(--checkbox-checked-icon-color);
            margin-top: -1px;
            left: 0px;
            top: 50%;
            height: 1px;
            transform: scale(.5);
          }

          &::after {
            display: none;
          }
        }
      }
    }
    @e inner {
      display: inline-block;
      position: relative;
      top: 4px;
      /*border: var(--checkbox-input-border);*/
      border-radius: var(--checkbox-input-border-radius);
      box-sizing: border-box;
      rect: var(--checkbox-input-width) var(--checkbox-input-height) var(--checkbox-input-fill);
      z-index: var(--index-normal);
      /*transition: border-color .25s cubic-bezier(.71,-.46,.29,1.46),*/
      /*background-color .25s cubic-bezier(.71,-.46,.29,1.46);*/
      border:1px solid rgba(var(--color-black), 0.16);
      &:hover {
        background-color: rgba(var(--color-black),0.08);
        /*border-color: var(--checkbox-input-border-color-hover);*/
      }
      &.border::before{
        /*border:2px solid black;*/
       }
      &::before {
         content: "";
         border: 1px solid transparent;
         width: 16px;
         height: 16px;
         display: inline-block;
         margin-top: -2px;
         margin-left: -2px;
         border-radius: 6px;
         position: absolute;
       }
      &::after {
        box-sizing: content-box;
        content: "";
        border: 1px solid var(--checkbox-checked-icon-color);
        border-left: 0;
        border-top: 0;
        height: 7px;
        left: 5px;
        position: absolute;
        top: 2px;
        transform: rotate(45deg) scaleY(0);
        width: 4px;
        transition: transform .15s cubic-bezier(.71,-.46,.88,.6) .05s;
        transform-origin: center;
      }
    }

    @e original {
      opacity: 0;
      size: 0;
      width: 16px;
      height:16px;
      top: 4px;
      position: relative;
      margin-left: -18px;
    }

    @e label {
      font-size: var(--checkbox-font-size);
      padding-left: 24px;
      display: inline-block;
      vertical-align: middle;
    }

    & + .el-checkbox {
      margin-left: 16px;
    }
  }

  @b checkbox-button {
    position: relative;
    display: inline-block;

    @e inner {
      display: inline-block;
      line-height: 1;
      white-space: nowrap;
      vertical-align: middle;
      cursor: pointer;
      background: var(--button-default-fill);
      /*border: var(--border-base);*/
      border-left: 0;
      color: var(--button-default-color);
      -webkit-appearance: none;
      text-align: center;
      box-sizing: border-box;
      outline: none;
      margin: 0;
      position: relative;
      cursor: pointer;
      transition: var(--all-transition);
      @utils-user-select none;

      @mixin button-size var(--button-padding-vertical), var(--button-padding-horizontal), var(--button-font-size), 0;

      &:hover {
        color: var(--color-blue-60);
      }

      & [class*="el-icon-"] {
        line-height: 0.9;

        & + span {
          margin-left: 5px;
        }
      }
    }

    @e original {
      opacity: 0;
      outline: none;
      visibility: hidden;
    }

    &.is-checked {
      & .el-checkbox-button__inner {
        color: var(--checkbox-button-checked-color);
        background-color: var(--checkbox-button-checked-fill);
        border-color: var(--checkbox-button-checked-border-color);
        /*box-shadow: -1px 0 0 0 var(--checkbox-button-checked-border-color);*/
      }
    }

    &.is-disabled {
      & .el-checkbox-button__inner {
        color: var(--button-disabled-color);
        cursor: not-allowed;
        background-image: none;
        background-color: var(--button-disabled-fill);
        border-color: var(--button-disabled-border);
        box-shadow: none;
      }
    }

    &.is-focus {
      & .el-checkbox-button__inner {
        border-color: var(--checkbox-button-checked-border-color);
      }
    }

    &:first-child {
      .el-checkbox-button__inner {
        border-left: var(--border-base);
        border-radius: var(--border-radius-base) 0 0 var(--border-radius-base);
        box-shadow: none !important;
      }
    }
    &:last-child {
      .el-checkbox-button__inner {
        border-radius: 0 var(--border-radius-base) var(--border-radius-base) 0;
      }
    }
    @m large {
      & .el-checkbox-button__inner {
        @mixin button-size var(--button-large-padding-vertical), var(--button-large-padding-horizontal), var(--button-large-font-size), 0;
      }
    }
    @m small {
      & .el-checkbox-button__inner {
        @mixin button-size var(--button-small-padding-vertical), var(--button-small-padding-horizontal), var(--button-small-font-size), 0;
      }
    }
    @m mini {
      & .el-checkbox-button__inner {
        @mixin button-size var(--button-mini-padding-vertical), var(--button-mini-padding-horizontal), var(--button-mini-font-size), 0;
      }
    }
  }
}
.el-checkbox__input.is-checked .el-checkbox__inner:hover{
  background-color: var(--color-blue-60);
  border-color: var(--color-blue-60);
}
.el-checkbox__input.is-checked.is-focus .el-checkbox__inner{
  background-color: var(--color-blue-70);
  border-color: var(--color-blue-70);
}
/*high contract*/
@media screen and (-ms-high-contrast: active) {
  .el-button:focus, .el-button-group .el-button:focus {
    outline: 1px dotted;
    border: 1px solid yellow;
  }
  .loading—animation > div {
    background-color: yellow;
  }
  .el-checkbox__input.is-focus .el-checkbox__inner {
    outline: 1px dotted;
    border: 1px solid yellow;
  }
}
