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