8
8
flex-wrap : wrap;
9
9
}
10
10
11
- .setting-line .radio-line input {
11
+ .setting-line .radio-line input ,
12
+ .setting-line .toggle input {
12
13
margin-right : 0.3em ;
13
14
height : 1.2rem ;
14
15
width : 1.2rem ;
17
18
outline : none;
18
19
-webkit-appearance : none;
19
20
cursor : pointer;
21
+ }
22
+ .setting-line .radio-line input {
20
23
border-radius : 50% ;
21
24
}
22
- .setting-line .radio-line input + span {
25
+ .setting-line .toggle input : checked {
26
+ content : url ('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40">\
27
+ <path d= "M7,25L17,32L33,12" fill="none" stroke="black" stroke-width="5"/>\
28
+ <path d= "M7,23L17,30L33,10" fill="none" stroke="white" stroke-width="5"/></svg>');
29
+ }
30
+
31
+ .setting-line .radio-line input + span ,
32
+ .setting-line .toggle span {
23
33
padding-bottom : 1px ;
24
34
}
25
35
49
59
cursor : pointer;
50
60
}
51
61
52
- .toggle input {
53
- opacity : 0 ;
54
- position : absolute;
55
- }
56
-
57
- .slider {
58
- position : relative;
59
- width : 45px ;
60
- min-width : 45px ;
61
- display : block;
62
- height : 28px ;
63
- margin-right : 20px ;
64
- cursor : pointer;
65
- background-color : # ccc ;
66
- transition : .3s ;
67
- }
68
-
69
- .slider : before {
70
- position : absolute;
71
- content : "" ;
72
- height : 19px ;
73
- width : 19px ;
74
- left : 4px ;
75
- bottom : 4px ;
76
- transition : .3s ;
77
- }
78
-
79
- input : checked + .slider : before {
80
- transform : translateX (19px );
81
- }
82
-
83
62
.setting-line > .sub-settings {
84
63
padding-left : 42px ;
85
64
width : 100% ;
@@ -94,17 +73,19 @@ input:checked + .slider:before {
94
73
box-shadow : inset 0 0 0 3px var (--main-background-color );
95
74
background-color : var (--settings-input-color );
96
75
}
97
- .setting-line .radio-line input : focus {
76
+ .setting-line .toggle input : checked {
77
+ background-color : var (--settings-input-color );
78
+ }
79
+ .setting-line .radio-line input : focus ,
80
+ .setting-line .toggle input : focus {
98
81
box-shadow : 0 0 1px 1px var (--settings-input-color );
99
82
}
100
83
/* In here we combine both `:focus` and `:checked` properties. */
101
84
.setting-line .radio-line input : checked : focus {
102
85
box-shadow : inset 0 0 0 3px var (--main-background-color ),
103
86
0 0 2px 2px var (--settings-input-color );
104
87
}
105
- .setting-line .radio-line input : hover {
88
+ .setting-line .radio-line input : hover ,
89
+ .setting-line .toggle input : hover {
106
90
border-color : var (--settings-input-color ) !important ;
107
91
}
108
- input : checked + .slider {
109
- background-color : var (--settings-input-color );
110
- }
0 commit comments