File size: 941 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
@import 'src/assets/css/mixin.scss';
.JoL-player-container{
  body {
    --JoL-theme: red;
  }
  .container {
    display: flex;
    align-items: center;
    font-size: 14px;
  }
  .label {
    padding-right: 20px;
    cursor: pointer;
  }
  .switch {
    position: relative;
    @include wh(30px, 15px);
    background-color: #dadada;
    border-radius: 30px;
    border: none;
    outline: none;
    -webkit-appearance: none;
    transition: all 0.2s ease;
    cursor: pointer;
  }

  // 按钮
  .switch::after {
    content: '';
    @include wh(50%, 100%);
    @include position(absolute, 0, auto, auto, 0);
    background-color: #fff;
    border-radius: 50%;
    transition: all 0.2s ease;
  }

  // checked状态时,背景颜色改变
  .switch:checked {
    background-color: var(--JoL-theme);
  }
  // checked状态时,按钮位置改变
  .switch:checked::after {
    left: 50%;
  }
}