aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-forms/input-switch.component.scss
blob: 8ee8a371dbd56b608eae0e67bea312fe5dc26a56 (plain) (blame)
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
@use '_variables' as *;
@use '_mixins' as *;

input {
  position: absolute;
  visibility: hidden;

  + label {
    cursor: pointer;
    text-indent: -9999px;
    width: 35px;
    height: 20px;
    background: #cccccc;
    display: block;
    border-radius: 100px;
    position: relative;
    margin: 0;

    &::after {
      content: '';
      position: absolute;
      top: 3px;
      left: 3px;
      width: 14px;
      height: 14px;
      background: pvar(--mainBackgroundColor);
      border-radius: 50%;
      transition: 0.3s ease-out;
    }

    &:active::after {
      width: 40px;
    }
  }

  &:checked + label {
    background: pvar(--mainColor);

    &::after {
      left: calc(100% - 3px);
      transform: translateX(-100%);
    }
  }
}