aboutsummaryrefslogtreecommitdiffstats
path: root/src/styles/toggle.scss
blob: 52675ceed82c6f81e5b39b686c76873f82a37878 (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
@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: $toggle-size / 2;

  .franz-form__toggle-button {
    background: $dark-theme-gray-lighter;
    box-shadow: 0 1px 4px rgba($dark-theme-black, .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, .3);
      height: $toggle-size - 2;
      left: 1px;
      top: 1px;
      position: absolute;
      transition: all .5s;
      width: $toggle-size - 2;
    }

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

    input { display: none; }
  }
}