啊鑫
7 天以前 fca192d3c38c5dcfbb6ace8bc71d6078f6a079b2
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
@import '../style/var';
 
.van-switch {
  position: relative;
  display: inline-block;
  box-sizing: content-box;
  width: @switch-width;
  height: @switch-height;
  font-size: @switch-size;
  background-color: @switch-background-color;
  border: @switch-border;
  border-radius: @switch-node-size;
  cursor: pointer;
  transition: background-color @switch-transition-duration;
 
  &__node {
    position: absolute;
    top: 0;
    left: 0;
    width: @switch-node-size;
    height: @switch-node-size;
    // https://github.com/vant-ui/vant/issues/9839
    font-size: inherit;
    background-color: @switch-node-background-color;
    border-radius: 100%;
    box-shadow: @switch-node-box-shadow;
    transition: transform @switch-transition-duration
      cubic-bezier(0.3, 1.05, 0.4, 1.05);
  }
 
  &__loading {
    top: 25%;
    left: 25%;
    width: 50%;
    height: 50%;
    line-height: 1;
  }
 
  &--on {
    background-color: @switch-on-background-color;
 
    .van-switch__node {
      transform: translateX(@switch-width - @switch-node-size);
    }
 
    .van-switch__loading {
      color: @switch-on-background-color;
    }
  }
 
  &--disabled {
    cursor: not-allowed;
    opacity: @switch-disabled-opacity;
  }
 
  &--loading {
    cursor: default;
  }
}