aboutsummaryrefslogtreecommitdiffstats
path: root/src/styles/toggle.scss
blob: ed4c0d11b2d1208711dedb21dc703867d0e1cd0d (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
45
46
47
48
49
50
51
52
53
54
55
56
57
@use "sass:math";

@import './config.scss';

$toggle-size: 14px;
$toggle-width: 40px;
$toggle-button-size: 22px;

.theme__dark .franz-form .franz-form__toggle-wrapper .franz-form__toggle {
  background: $dark-theme-gray;
  border-radius: math.div($toggle-size, 2);

  .franz-form__toggle-button {
    background: $dark-theme-gray-lighter;
    box-shadow: 0 1px 4px rgba($dark-theme-black, 0.3);
  }
}

.franz-form .franz-form__toggle-wrapper {
  display: flex;
  flex-direction: row;

  .franz-form__label {
    margin-left: 20px;
  }

  .franz-form__toggle {
    background: $theme-gray-lighter;
    border-radius: $theme-border-radius;
    height: $toggle-size;
    position: relative;
    width: $toggle-width;

    .franz-form__toggle-button {
      background: $theme-gray-light;
      border-radius: 100%;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
      height: $toggle-size - 2;
      left: 1px;
      top: 1px;
      position: absolute;
      @media (prefers-reduced-motion: no-preference) {
        transition: all 0.5s;
      }
      width: $toggle-size - 2;
    }

    &.is-active .franz-form__toggle-button {
      background: $theme-brand-primary;
      left: $toggle-width - $toggle-size - 3;
    }

    input {
      display: none;
    }
  }
}