-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswitchStyles.css
More file actions
66 lines (58 loc) · 1.33 KB
/
Copy pathswitchStyles.css
File metadata and controls
66 lines (58 loc) · 1.33 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
/* :root {
--primaryAccentColour: #854fe8;
} */
/* The switch - the box around the slider */
.switch {
font-size: 17px;
position: relative;
display: inline-block;
width: 3.5em;
height: 2em;
margin-left: auto;
margin-right: 40px;
margin-top: calc(35px - 1em);
}
/* Hide default HTML checkbox */
.switch input {
opacity: 0;
width: 0;
height: 0;
}
/* The slider */
.slider {
position: absolute;
cursor: pointer;
inset: 0;
background: #ececec;
border-radius: 50px;
outline-style: solid;
outline-width: 3px;
outline-color: var(--primaryAccentColour);
transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1);
transition: outline-width 0.05s ease;
}
.slider:before {
position: absolute;
content: "";
height: 1.4em;
width: 1.4em;
left: 0.3em;
bottom: 0.3em;
background-color: white;
border-radius: 50px;
box-shadow: 0 0px 20px rgba(0,0,0,0.4);
transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.switch input:checked + .slider {
background: var(--primaryAccentColour);
outline-width: 0;
}
.switch input:focus + .slider {
box-shadow: 0 0 1px var(--primaryAccentColour);
}
.switch input:checked + .slider:before {
transform: translateX(1.6em);
width: 2em;
height: 2em;
bottom: 0;
}