-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathswitch.scss
More file actions
99 lines (85 loc) · 1.76 KB
/
Copy pathswitch.scss
File metadata and controls
99 lines (85 loc) · 1.76 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
@import '~styles/includes';
.obojobo-draft--components--switch {
position: relative;
//@HACK: Fixes the .info dialog being blurry sometimes in CHROME
transform: translate3d(0, 0, 0);
z-index: 1;
> span {
padding-right: 0.5em;
vertical-align: middle;
}
.switch {
position: absolute;
right: 0;
display: inline-block;
width: 2.6em;
height: 1em;
top: 50%;
transform: translate(0, -50%);
font-size: 1.2em;
input {
opacity: 0;
}
.switch-slider {
$color-switch-text: lighten($color-text, 20%);
border: 1px solid $color-shadow;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: $color-bg2;
transition: 0.4s;
border-radius: 0.7em;
cursor: pointer;
width: 2.5em;
// Circle slider
&::before {
border: 1px solid $color-shadow;
position: absolute;
content: '';
height: 0.7em;
width: 0.7em;
left: 0.05em;
background-color: $color-bg;
transition: 0.4s;
border-radius: 50%;
z-index: 1;
top: 0.05em;
}
&::after {
content: 'OFF';
font-family: $font-default;
color: $color-switch-text;
font-weight: bold;
display: block;
position: absolute;
transform: translate(-50%, -50%);
top: 50%;
left: 62%;
font-size: 0.5em;
}
}
input:checked + .switch-slider {
background-color: $color-obojobo-blue;
}
input:focus + .switch-slider {
box-shadow: 0 0 10px $color-obojobo-blue;
}
input:checked + .switch-slider::before {
transform: translateX(1.6em);
background-color: $color-bg;
border: 1px solid $color-bg;
}
input:checked + .switch-slider::after {
content: 'ON';
color: $color-bg;
left: 37%;
}
}
small {
font-size: 0.8em;
color: $color-neutral-text;
margin-top: 0;
}
}