Blame view

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