summaryrefslogtreecommitdiff
path: root/src/components/ToggleSwitch.module.css
blob: 78a2b41eb78bb67b04fddbef477d580c048ea7ff (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
.ToggleSwitch {
  user-select: none;
  border: 1px solid #525252;
  color: var(--color-text);
  background: var(--color-toggle-bg);
  display: flex;
  position: relative;

  input {
    position: absolute;
    left: 0;
    opacity: 0;
  }

  label {
    flex: 1;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    cursor: pointer;
  }
}

.slider {
  z-index: 1;
  position: absolute;
  display: block;
  left: 0;
  height: 100%;
  transition: left 0.2s ease-out;
  background: var(--color-toggle-selected);
}