summaryrefslogtreecommitdiff
path: root/ui/styles/toggles.css
blob: efa0cc0ef19f3ed37a4109abb6f60c7e0ca48640 (plain)
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
.toggle {
  position: relative;
  display: inline-block;
  width: 2rem;
  height: 1rem;
  border: 1px solid var(--colour-navbar-bg);
  border-radius: 1rem;
}

.toggle input {
  display: none;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #bbb;
  transition: 0.4s;
  border-radius: 1rem;
}

.slider:before {
  position: absolute;
  content: '';
  height: 1rem;
  width: 1rem;
  background-color: #fff;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--colour-navbar-bg);
}

input:checked + .slider:before {
  transform: translateX(1rem);
}