zxl
19 小时以前 172933f098017bc4c4f57dcda0d490ea12bb13bb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
// text
@prefixCls: zk-checkbox;
// color
@border: #dddee1;
@hoverBorder: #bcbcbc;
@blue: #2d8cf0;
 
.@{prefixCls}-wrapper {
  display: flex;
  justify-content: center;
}
 
.@{prefixCls} {
  display: inline-block;
  position: relative;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  outline: none;
  &:hover {
    .@{prefixCls}__inner {
      border-color: @hoverBorder;
    }
  }
}
 
.@{prefixCls}__inner {
  display: inline-block;
  width: 14px;
  height: 14px;
  position: relative;
  top: 0;
  left: 0;
  border: 1px solid @border;
  border-radius: 2px;
  background-color: #ffffff;
  transition: border-color .2s ease-in-out,background-color .2s ease-in-out;
  &::after {
    content: "";
    display: table;
    width: 4px;
    height: 8px;
    position: absolute;
    top: 1px;
    left: 4px;
    border: 2px solid #fff;
    border-top: 0;
    border-left: 0;
    transform: rotate(45deg) scale(0);
    transition: all .2s ease-in-out;
  }
}
 
.@{prefixCls}--indeterminate {
  .@{prefixCls}__inner {
    background-color: @blue;
    border-color: @blue;
    &::after {
      content: "";
      width: 8px;
      height: 1px;
      transform: scale(1);
      position: absolute;
      left: 2px;
      top: 5px;
    }
  }
  &:hover {
    .@{prefixCls}__inner {
      border-color: @blue;
    }
  }
}
 
.@{prefixCls}--checked {
  .@{prefixCls}__inner {
    border-color: @blue;
    background-color: @blue;
    &::after {
      content: "";
      display: table;
      width: 4px;
      height: 8px;
      position: absolute;
      top: 1px;
      left: 4px;
      border: 2px solid #ffffff;
      border-top: 0;
      border-left: 0;
      transform: rotate(45deg) scale(1);
      transition: all .2s ease-in-out;
    }
  }
  &:hover {
    .@{prefixCls}__inner {
      border-color: @blue;
    }
  }
}
 
.@{prefixCls}--disabled {
  cursor: not-allowed;
  .@{prefixCls}__inner {
    background-color: #f3f3f3;
    border-color: @border;
    &::after {
      animation-name: none;
      border-color: #ccc;
    }
  }
  &:hover {
    .@{prefixCls}__inner {
      border-color: @border;
    }
  }
}