Blame view

src/styles/components/switch.less 3.65 KB
07aa688e   梁灏   add Switch UI
1
2
3
4
  @switch-prefix-cls: ~"@{css-prefix}switch";
  
  .@{switch-prefix-cls} {
      display: inline-block;
ac2f8493   梁灏   update Switch style
5
6
7
8
      width: 44px;
      height: 22px;
      line-height: 20px;
      border-radius: 22px;
07aa688e   梁灏   add Switch UI
9
      vertical-align: middle;
2bfebe0c   chenhaodong   fix
10
      /*wynn*/
36b9106f   wynn   ui
11
12
      border: 1px solid @mew-common-color;
      background-color: #efefef;
07aa688e   梁灏   add Switch UI
13
14
      position: relative;
      cursor: pointer;
e2645048   jingsam   :fire: remove tra...
15
16
      user-select: none;
      transition: all @transition-time @ease-in-out;
07aa688e   梁灏   add Switch UI
17
  
eb7f31db   梁灏   Switch add loadin...
18
19
20
21
      &-loading{
          opacity: .4;
      }
  
07aa688e   梁灏   add Switch UI
22
      &-inner {
36b9106f   wynn   ui
23
          color: @mew-common-color;
3c01d81a   梁灏   fixed Modal bug,w...
24
          font-size: @font-size-small;
07aa688e   梁灏   add Switch UI
25
          position: absolute;
ac2f8493   梁灏   update Switch style
26
          left: 23px;
95436eeb   梁灏   add InputNumber UI
27
  
e2645048   jingsam   :fire: remove tra...
28
          i {
95436eeb   梁灏   add InputNumber UI
29
30
31
              width: 12px;
              height: 12px;
              text-align: center;
d79eaf9b   梁灏   update Switch style
32
33
              position: relative;
              top: -1px;
95436eeb   梁灏   add InputNumber UI
34
          }
07aa688e   梁灏   add Switch UI
35
36
      }
  
2bfebe0c   chenhaodong   fix
37
      /*wynn*/
07aa688e   梁灏   add Switch UI
38
39
      &:after {
          content: '';
ac2f8493   梁灏   update Switch style
40
41
42
          width: 18px;
          height: 18px;
          border-radius: 18px;
36b9106f   wynn   ui
43
          background-color: @mew-common-color;
07aa688e   梁灏   add Switch UI
44
          position: absolute;
2af5843d   梁灏   Switch add large ...
45
46
          left: 1px;
          top: 1px;
07aa688e   梁灏   add Switch UI
47
          cursor: pointer;
e2645048   jingsam   :fire: remove tra...
48
          transition: left @transition-time @ease-in-out, width @transition-time @ease-in-out;
07aa688e   梁灏   add Switch UI
49
50
51
52
53
54
      }
  
      &:active:after {
          width: 26px;
      }
  
2bfebe0c   chenhaodong   fix
55
      /*wynn*/
eb7f31db   梁灏   Switch add loadin...
56
57
58
59
60
61
62
63
64
65
66
      &:before{
          content: '';
          display: none;
          width: 14px;
          height: 14px;
          border-radius: 50%;
          background-color: transparent;
          position: absolute;
          left: 3px;
          top: 3px;
          z-index: 1;
36b9106f   wynn   ui
67
68
          border: 1px solid @mew-common-color;
          border-color: transparent transparent transparent #3fcdc0;
eb7f31db   梁灏   Switch add loadin...
69
70
71
72
73
74
75
          animation: switch-loading 1s linear;
          animation-iteration-count: infinite;
      }
      &-loading:before{
          display: block;
      }
  
2bfebe0c   chenhaodong   fix
76
      /*wynn*/
07aa688e   梁灏   add Switch UI
77
      &:focus {
36b9106f   wynn   ui
78
          box-shadow: 0 0 0 2px fade(@mew-common-color, 20%);
07aa688e   梁灏   add Switch UI
79
80
81
82
83
84
85
86
          outline: 0;
      }
  
      &:focus:hover {
          box-shadow: none;
      }
  
      &-small {
ac2f8493   梁灏   update Switch style
87
88
89
          width: 28px;
          height: 16px;
          line-height: 14px;
07aa688e   梁灏   add Switch UI
90
          &:after {
ac2f8493   梁灏   update Switch style
91
92
              width: 12px;
              height: 12px;
07aa688e   梁灏   add Switch UI
93
94
          }
          &:active:after {
2af5843d   梁灏   Switch add large ...
95
              width: 14px;
07aa688e   梁灏   add Switch UI
96
          }
eb7f31db   梁灏   Switch add loadin...
97
98
99
100
101
102
          &:before{
              width: 10px;
              height: 10px;
              left: 2px;
              top: 2px;
          }
07aa688e   梁灏   add Switch UI
103
104
105
      }
  
      &-small&-checked:after {
ac2f8493   梁灏   update Switch style
106
          left: 13px;
07aa688e   梁灏   add Switch UI
107
      }
eb7f31db   梁灏   Switch add loadin...
108
109
110
      &-small&-checked:before {
          left: 14px;
      }
07aa688e   梁灏   add Switch UI
111
112
  
      &-small:active&-checked:after {
ac2f8493   梁灏   update Switch style
113
          left: 11px;
2af5843d   梁灏   Switch add large ...
114
115
116
      }
  
      &-large{
ac2f8493   梁灏   update Switch style
117
          width: 56px;
2af5843d   梁灏   Switch add large ...
118
119
120
121
122
123
          &:active:after {
              width: 26px;
          }
      }
  
      &-large:active:after {
ac2f8493   梁灏   update Switch style
124
          width: 30px;
2af5843d   梁灏   Switch add large ...
125
126
127
      }
  
      &-large&-checked:after {
ac2f8493   梁灏   update Switch style
128
          left: 35px;
2af5843d   梁灏   Switch add large ...
129
      }
eb7f31db   梁灏   Switch add loadin...
130
131
132
      &-large&-checked:before {
          left: 37px;
      }
2af5843d   梁灏   Switch add large ...
133
134
  
      &-large:active&-checked:after {
ac2f8493   梁灏   update Switch style
135
          left: 23px;
07aa688e   梁灏   add Switch UI
136
137
      }
  
2bfebe0c   chenhaodong   fix
138
      /*wynn*/
07aa688e   梁灏   add Switch UI
139
      &-checked {
36b9106f   wynn   ui
140
141
          border-color: @mew-common-color;
          background-color: #e8e8e8;
07aa688e   梁灏   add Switch UI
142
143
  
          .@{switch-prefix-cls}-inner {
ac2f8493   梁灏   update Switch style
144
              left: 7px;
07aa688e   梁灏   add Switch UI
145
146
147
          }
  
          &:after {
ac2f8493   梁灏   update Switch style
148
              left: 23px;
07aa688e   梁灏   add Switch UI
149
          }
eb7f31db   梁灏   Switch add loadin...
150
151
152
          &:before{
              left: 25px;
          }
07aa688e   梁灏   add Switch UI
153
154
  
          &:active:after {
ac2f8493   梁灏   update Switch style
155
              left: 15px;
07aa688e   梁灏   add Switch UI
156
157
158
159
160
          }
      }
  
      &-disabled {
          cursor: @cursor-disabled;
1c35a44d   梁灏   update Switch style
161
          opacity: .4;
07aa688e   梁灏   add Switch UI
162
163
  
          &:after {
1c35a44d   梁灏   update Switch style
164
              background: #fff;
07aa688e   梁灏   add Switch UI
165
166
167
168
              cursor: not-allowed;
          }
  
          .@{switch-prefix-cls}-inner {
1c35a44d   梁灏   update Switch style
169
              color: #fff;
07aa688e   梁灏   add Switch UI
170
171
          }
      }
1a4a76e9   梁灏   update Page style
172
  
2bfebe0c   chenhaodong   fix
173
      /*wynn*/
43d3eb1b   Aresn   Update switch.less
174
      &-disabled&-checked{
36b9106f   wynn   ui
175
176
          border-color: @mew-common-color;
          background-color: #e8e8e8;
11d8490e   Haven   style (switch): ...
177
178
179
          opacity: .4;
          
          &:after {
36b9106f   wynn   ui
180
              background: @mew-common-color;
11d8490e   Haven   style (switch): ...
181
182
183
184
185
186
187
          }
  
          .@{switch-prefix-cls}-inner {
              color: #fff;
          }
      }
  
e2645048   jingsam   :fire: remove tra...
188
  }
eb7f31db   梁灏   Switch add loadin...
189
190
191
192
193
194
195
196
  
  @keyframes switch-loading {
      0% {
          transform: rotate(0);
      }
      100% {
          transform: rotate(360deg);
      }
11d8490e   Haven   style (switch): ...
197
  }