UNPKG

1.95 kBSCSSView Raw
1@import '../../styles/common/colors';
2
3.toggle-component {
4 align-items: center;
5 display: inline-flex;
6 margin: 0 -8px;
7 padding: 0 8px;
8
9 .toggle-wrapper {
10 cursor: pointer;
11 display: inline-flex;
12 height: 20px;
13 position: relative;
14 width: 50px;
15
16 &.no-text {
17 width: 40px;
18
19 .inner {
20 right: 21px;
21 }
22 }
23
24 .outer {
25 background: $neutral-4;
26 border-radius: 100px;
27 bottom: 0;
28 left: 0;
29 right: 0;
30 position: absolute;
31 transition: background 0.15s ease-in;
32 top: 0;
33
34 &.on {
35 background: $success;
36 }
37 }
38
39 .inner {
40 background: $white;
41 border-radius: 50%;
42 height: 16px;
43 position: absolute;
44 right: 31px;
45 top: 1px;
46 transition: background 0.15s ease-in, right 0.15s ease-out;
47 width: 16px;
48 box-shadow: 1px 0 2px 0 rgba(45,62,80,0.1);
49 border: 1px solid $neutral-4;
50
51 &.on {
52 background: $white;
53 right: 1px;
54 border: 1px solid $success;
55 }
56
57 &.loading {
58 background: transparent;
59 }
60 }
61
62 .text {
63 position: relative;
64 color: $white;
65 font-size: 12px;
66 z-index: 1;
67 left: 24px;
68 font-weight: 500;
69 top: 3px;
70 user-select: none;
71
72 &.on {
73 left: 8px;
74 }
75 }
76
77 &.toggle-disabled {
78 cursor: not-allowed;
79
80 .outer {
81 background: $neutral-3;
82 }
83 .inner {
84 border: 1px solid $neutral-3;
85 }
86 }
87 }
88
89 &.toggle-red {
90 .outer.on {
91 background: $danger;
92 }
93 .inner.on {
94 border: 1px solid $danger;
95 }
96 }
97
98 label {
99 color: $primary-4;
100 cursor: pointer;
101 display: inline-block;
102 margin-right: 5px;
103 user-select: none;
104
105 &.toggle-disabled {
106 cursor: not-allowed;
107 }
108 }
109
110 .toggle-loader {
111 position: absolute;
112 top: -2px;
113 height: 20px;
114 width: 20px;
115 left: -2px;
116 }
117}