Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_switch.scss « components « sass « assets - github.com/zzossig/hugo-theme-zdoc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8b1c806f4a747d6f7ccf54b23d4e3e949ad7a37c (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* The switch - the box around the slider */
.switch {
  cursor: pointer;

  @include flexbox();
  @include align-items(center);
  @include justify-content(center);

  &__rel {
    position: relative;
    height: auto;
    padding: 0 6px;
    
    @include themify($themes) {
      color: themed('landing-button-default');
      @include on-event {
        color: themed('body-color');
        background-color: themed('dropdown-hover-background-color');
      }
    }
  }

  &__abs {
    position: absolute;
    left: -75px;
    top: -16px;
    z-index: z('menu');
    width: 50px;
    height: 50px;
    margin: auto 0;

    @include themify($themes) {
      color: themed('landing-button-default');
      @include on-event {
        color: themed('body-color');
      }
    }
  }
}

/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.slider {
  background-color: transparent;
  -webkit-transition: .2s;
  transition: .2s;

  &__icon {
    svg {
      @include flexbox();
      @include align-items(center);
    }
  }
}

input:checked + .slider:before {
  -webkit-transform: translateX(13px);
  -ms-transform: translateX(13px);
  transform: translateX(13px);
}