|
1 | 1 | @import '~src/themes.less';
|
2 | 2 |
|
3 |
| -.@{css-prefix}-checkbox { |
| 3 | +.@{css-prefix}-check-controller { |
4 | 4 | position: absolute;
|
5 | 5 | left: 0;
|
6 |
| - color: #1f2d3d; |
7 |
| - user-select: none; |
8 | 6 |
|
9 |
| - &.is-checked .@{css-prefix}-checkbox__inner { |
| 7 | + &.is-checked .@{css-prefix}-check-controller__inner { |
10 | 8 | background-color: @color-primary;
|
11 | 9 | border-color: darken(@color-primary, 10%);
|
12 | 10 |
|
13 |
| - &:after { |
| 11 | + &.is-checkbox:after { |
14 | 12 | transform: rotate(45deg) scaleY(1);
|
15 | 13 | }
|
| 14 | + |
| 15 | + &.is-radio:after { |
| 16 | + transform: translate(-50%, -50%) scale(1); |
| 17 | + } |
16 | 18 | }
|
17 | 19 |
|
18 |
| - .@{css-prefix}-checkbox__inner { |
| 20 | + .@{css-prefix}-check-controller__inner { |
19 | 21 | display: inline-block;
|
20 | 22 | position: relative;
|
21 | 23 | border: 1px solid @border-color;
|
|
45 | 47 | transition: transform 0.15s cubic-bezier(0.71, -0.46, 0.88, 0.6) 0.05s;
|
46 | 48 | transform-origin: center;
|
47 | 49 | }
|
48 |
| - } |
49 |
| - |
50 |
| - .@{css-prefix}-checkbox__original { |
51 |
| - opacity: 0; |
52 |
| - outline: none; |
53 |
| - position: absolute; |
54 |
| - z-index: -1; |
55 |
| - top: 0; |
56 |
| - left: 0; |
57 |
| - right: 0; |
58 |
| - bottom: 0; |
59 |
| - margin: 0; |
60 |
| - } |
61 |
| -} |
62 | 50 |
|
63 |
| -.@{css-prefix}-radio { |
64 |
| - position: absolute; |
65 |
| - left: 0; |
66 |
| - color: #1f2d3d; |
67 |
| - user-select: none; |
68 |
| - |
69 |
| - &.is-checked .@{css-prefix}-radio__inner { |
70 |
| - background-color: @color-primary; |
71 |
| - border-color: darken(@color-primary, 10%); |
72 |
| - |
73 |
| - &:after { |
74 |
| - transform: translate(-50%, -50%) scale(1); |
75 |
| - } |
76 |
| - } |
77 |
| - |
78 |
| - .@{css-prefix}-radio__inner { |
79 |
| - border: 1px solid @border-color; |
80 |
| - border-radius: 100%; |
81 |
| - width: 16px; |
82 |
| - height: 16px; |
83 |
| - vertical-align: middle; |
84 |
| - background-color: #fff; |
85 |
| - position: relative; |
86 |
| - cursor: pointer; |
87 |
| - display: inline-block; |
88 |
| - box-sizing: border-box; |
89 |
| - |
90 |
| - &:after { |
91 |
| - width: 4px; |
92 |
| - height: 4px; |
| 51 | + &.is-radio { |
93 | 52 | border-radius: 100%;
|
94 |
| - background-color: #fff; |
95 |
| - content: ''; |
96 |
| - position: absolute; |
97 |
| - left: 50%; |
98 |
| - top: 50%; |
99 |
| - transform: translate(-50%, -50%) scale(0); |
100 |
| - transition: transform 0.15s ease-in; |
| 53 | + |
| 54 | + &:after { |
| 55 | + border-radius: 100%; |
| 56 | + height: 4px; |
| 57 | + background-color: #fff; |
| 58 | + left: 50%; |
| 59 | + top: 50%; |
| 60 | + } |
101 | 61 | }
|
102 | 62 | }
|
103 | 63 |
|
104 |
| - .@{css-prefix}-radio__original { |
| 64 | + .@{css-prefix}-check-controller__original { |
105 | 65 | opacity: 0;
|
106 | 66 | outline: none;
|
107 | 67 | position: absolute;
|
|
0 commit comments