6 /// @Foundation.settings
\r
8 $switch-width: rem-calc(50) !default;
\r
9 $switch-height: rem-calc(32) !default;
\r
10 $switch-background: #ccc !default;
\r
11 $switch-background-active: $primary-color !default;
\r
12 $switch-border: 0 !default;
\r
13 $switch-radius: 9999px !default;
\r
14 $switch-animation-speed: 0.15s !default;
\r
16 $switch-paddle-color: white !default;
\r
17 $switch-paddle-offset: 4px !default;
\r
23 display: inline-block;
\r
32 -ms-touch-action: manipulation;
\r
33 touch-action: manipulation;
\r
52 Defines the dimmensions of the switch.
\r
54 $width - width of the switch.
\r
55 $height - height of the switch.
\r
57 @mixin switch-layout(
\r
58 $width: $switch-width,
\r
59 $height: $switch-height
\r
70 input:checked + label {
\r
72 left: $width - $height;
\r
77 @mixin switch-style(
\r
78 $background: $switch-background,
\r
79 $background-active: $switch-background-active,
\r
80 $border: $switch-border,
\r
81 $radius: $switch-radius,
\r
82 $paddle-color: $switch-paddle-color,
\r
83 $paddle-offset: $switch-paddle-offset,
\r
84 $animation-speed: $switch-animation-speed
\r
86 @if hasvalue($border) {
\r
89 border-radius: $radius;
\r
92 background: $background;
\r
95 background: $paddle-color;
\r
96 border-radius: $radius;
\r
97 transition: left $animation-speed ease-out;
\r
99 @if hasvalue($paddle-offset) {
\r
100 border: $paddle-offset solid $background
\r
105 input:checked + label {
\r
106 background: $background-active;
\r
110 @if hasvalue($paddle-offset) {
\r
111 border-color: $background-active;
\r
119 @include switch-layout;
\r
120 @include switch-style;
\r
123 @include exports(switch) {
\r
127 &.small { @include switch-layout(rem-calc(40), rem-calc(26)); }
\r
128 &.large { @include switch-layout(rem-calc(60), rem-calc(38)); }
\r