1 |
|
2 |
|
3 |
|
4 |
|
5 | .ant-switch {
|
6 | margin: 0;
|
7 | padding: 0;
|
8 | color: rgba(0, 0, 0, 0.85);
|
9 | font-size: 14px;
|
10 | font-variant: tabular-nums;
|
11 | line-height: 1.5715;
|
12 | list-style: none;
|
13 | font-feature-settings: 'tnum';
|
14 | position: relative;
|
15 | display: inline-block;
|
16 | box-sizing: border-box;
|
17 | min-width: 44px;
|
18 | height: 22px;
|
19 | line-height: 22px;
|
20 | vertical-align: middle;
|
21 | background-color: rgba(0, 0, 0, 0.25);
|
22 | border: 0;
|
23 | border-radius: 100px;
|
24 | cursor: pointer;
|
25 | transition: all 0.2s;
|
26 | -webkit-user-select: none;
|
27 | -moz-user-select: none;
|
28 | -ms-user-select: none;
|
29 | user-select: none;
|
30 | }
|
31 | .ant-switch:focus {
|
32 | outline: 0;
|
33 | box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
|
34 | }
|
35 | .ant-switch-checked:focus {
|
36 | box-shadow: 0 0 0 2px #e6f7ff;
|
37 | }
|
38 | .ant-switch:focus:hover {
|
39 | box-shadow: none;
|
40 | }
|
41 | .ant-switch-checked {
|
42 | background-color: #1890ff;
|
43 | }
|
44 | .ant-switch-loading,
|
45 | .ant-switch-disabled {
|
46 | cursor: not-allowed;
|
47 | opacity: 0.4;
|
48 | }
|
49 | .ant-switch-loading *,
|
50 | .ant-switch-disabled * {
|
51 | box-shadow: none;
|
52 | cursor: not-allowed;
|
53 | }
|
54 | .ant-switch-inner {
|
55 | display: block;
|
56 | margin: 0 7px 0 25px;
|
57 | color: #fff;
|
58 | font-size: 12px;
|
59 | transition: margin 0.2s;
|
60 | }
|
61 | .ant-switch-checked .ant-switch-inner {
|
62 | margin: 0 25px 0 7px;
|
63 | }
|
64 | .ant-switch-handle {
|
65 | position: absolute;
|
66 | top: 2px;
|
67 | left: 2px;
|
68 | width: 18px;
|
69 | height: 18px;
|
70 | transition: all 0.2s ease-in-out;
|
71 | }
|
72 | .ant-switch-handle::before {
|
73 | position: absolute;
|
74 | top: 0;
|
75 | right: 0;
|
76 | bottom: 0;
|
77 | left: 0;
|
78 | background-color: #fff;
|
79 | border-radius: 9px;
|
80 | box-shadow: 0 2px 4px 0 rgba(0, 35, 11, 0.2);
|
81 | transition: all 0.2s ease-in-out;
|
82 | content: '';
|
83 | }
|
84 | .ant-switch-checked .ant-switch-handle {
|
85 | left: calc(100% - 18px - 2px);
|
86 | }
|
87 | .ant-switch:not(.ant-switch-disabled):active .ant-switch-handle::before {
|
88 | right: -30%;
|
89 | left: 0;
|
90 | }
|
91 | .ant-switch:not(.ant-switch-disabled):active.ant-switch-checked .ant-switch-handle::before {
|
92 | right: 0;
|
93 | left: -30%;
|
94 | }
|
95 | .ant-switch-loading-icon.anticon {
|
96 | position: relative;
|
97 | top: 2px;
|
98 | color: rgba(0, 0, 0, 0.65);
|
99 | vertical-align: top;
|
100 | }
|
101 | .ant-switch-checked .ant-switch-loading-icon {
|
102 | color: #1890ff;
|
103 | }
|
104 | .ant-switch-small {
|
105 | min-width: 28px;
|
106 | height: 16px;
|
107 | line-height: 16px;
|
108 | }
|
109 | .ant-switch-small .ant-switch-inner {
|
110 | margin: 0 5px 0 18px;
|
111 | font-size: 12px;
|
112 | }
|
113 | .ant-switch-small .ant-switch-handle {
|
114 | width: 12px;
|
115 | height: 12px;
|
116 | }
|
117 | .ant-switch-small .ant-switch-loading-icon {
|
118 | top: 1.5px;
|
119 | font-size: 9px;
|
120 | }
|
121 | .ant-switch-small.ant-switch-checked .ant-switch-inner {
|
122 | margin: 0 18px 0 5px;
|
123 | }
|
124 | .ant-switch-small.ant-switch-checked .ant-switch-handle {
|
125 | left: calc(100% - 12px - 2px);
|
126 | }
|
127 | .ant-switch-rtl {
|
128 | direction: rtl;
|
129 | }
|
130 | .ant-switch-rtl .ant-switch-inner {
|
131 | margin: 0 25px 0 7px;
|
132 | }
|
133 | .ant-switch-rtl .ant-switch-handle {
|
134 | right: 2px;
|
135 | left: auto;
|
136 | }
|
137 | .ant-switch-rtl:not(.ant-switch-rtl-disabled):active .ant-switch-handle::before {
|
138 | right: 0;
|
139 | left: -30%;
|
140 | }
|
141 | .ant-switch-rtl:not(.ant-switch-rtl-disabled):active.ant-switch-checked .ant-switch-handle::before {
|
142 | right: -30%;
|
143 | left: 0;
|
144 | }
|
145 | .ant-switch-rtl.ant-switch-checked .ant-switch-inner {
|
146 | margin: 0 7px 0 25px;
|
147 | }
|
148 | .ant-switch-rtl.ant-switch-checked .ant-switch-handle {
|
149 | right: calc(100% - 18px - 2px);
|
150 | }
|
151 | .ant-switch-rtl.ant-switch-small.ant-switch-checked .ant-switch-handle {
|
152 | right: calc(100% - 12px - 2px);
|
153 | }
|