-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswitchbutton.css
More file actions
131 lines (111 loc) · 2.1 KB
/
switchbutton.css
File metadata and controls
131 lines (111 loc) · 2.1 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/* switch button 切换按钮*/
.u-switch-onoff {
position: relative;
width: 60px;
height: 34px;
border-radius: 100px;
background-color: #d9d9d9;
overflow: hidden;
}
.u-switch-onoff .check {
position: absolute;
display: block;
top: 0;
left: 0;
opacity: 0;
z-index: 6;
height: 100%;
width: 100%;
cursor: pointer;
}
.u-switch-onoff .switch {
left: 2px;
top: 3px;
bottom: 2px;
right: 28px;
background-color: #fff;
border-radius: 36px;
z-index: 1;
}
.u-switch-onoff .track {
left: 0;
top: 0;
right: 0;
bottom: 0;
}
.u-switch-onoff .switch, .u-switch-onoff .track {
position: absolute;
}
.u-switch-onoff .check:checked + .switch {
right: 2px;
left: 28px;
}
.u-switch-onoff .check:checked ~ .track {
box-shadow: inset 0 0 0 40px #03a9f4;
}
.u-switch-radio {
border-radius: 100%;
background-color: #d9d9d9;
width: 40px;
height: 40px;
position: relative;
}
.u-switch-radio .switch {
background-color: #fff;
border-radius: 100px;
width: 30px;
height: 30px;
position: absolute;
top: 5px;
left: 5px;
}
.u-switch-radio .check {
position: absolute;
height: 100%;
width: 100%;
opacity: 0;
cursor:pointer;
z-index: 6;
}
.u-switch-radio .check:checked + .switch {
background-color: #03a9f4;
}
.u-switch-checkbox {
width: 25px;
height: 25px;
position: relative;
}
.u-switch-checkbox .check, .u-switch-checkbox .switch {
position: absolute;
}
.u-switch-checkbox .check {
height: 100%;
width: 100%;
opacity: 0;
cursor: pointer;
z-index: 6;
}
.u-switch-checkbox .switch {
background: #eee;
border: 1px solid #ddd;
z-index: 1;
width: 25px;
height: 25px;
top: 0;
left: 0;
}
.u-switch-checkbox .switch .tick {
border: 3px solid #03a9f4;
border-top: none;
border-right: none;
transform: rotate(-45deg);
position: absolute;
height: 5px;
width: 9px;
top: 6px;
left: 7px;
opacity: 0.2;
}
.u-switch-checkbox .check:checked + .switch .tick {
opacity: 1;
}