1 /// @Foundation.settings
3 $btngroup-background: $primary-color !default;
4 $btngroup-color: #fff !default;
5 $btngroup-radius: $button-radius !default;
8 $child-selectors: '> a, > label, > button';
13 list-style-type: none;
15 border-radius: $btngroup-radius;
17 font-size: $button-font-size;
22 // Links become buttons
33 // Add borders between items
36 border-right: 1px solid scale-color($btngroup-background, $lightness: -25%);
45 vertical-align: middle;
47 margin-top: -2px; // The icons are oddly misaligned
52 %button-group-segmented {
53 border: 1px solid $primary-color;
54 transition-property: background color;
57 // Hide the radio button
58 > input[type="radio"] {
65 background: transparent;
70 @mixin button-group-size($size: medium, $expand: false) {
71 $size: $button-font-size * map-get($button-sizes, $size);
75 @include button-group-expand;
78 @mixin button-group-expand($stretch: true) {
79 display: if($stretch, flex, inline-flex);
82 flex: if($stretch, 1, 0 0 auto);
85 @if $stretch { @include button-expand; }
89 @mixin button-group-style(
91 $background: $primary-color,
98 @include button-style($background, auto, $color);
99 border-color: scale-color($background, $lightness: -15%);
102 #{$child-selectors} {
103 background: scale-color($background, $lightness: -15%);
109 @extend %button-group-segmented;
110 $hover-color: rgba($background, 0.25);
111 border-color: $background;
114 // This is the button
115 #{$child-selectors} {
116 border-color: $background;
119 // This is the button being hovered on
121 background: $hover-color;
126 .iconic { @include color-icon($background); }
130 // This is the button when it's active
132 > input:checked + label {
134 background: $background;
135 color: isitlight($background);
139 .iconic { @include color-icon(isitlight($background)); }
149 $background: $primary-color,
152 @extend %button-group;
153 @include button-group-expand($expand);
154 @include button-group-style($segmented, $background, $color);
155 border-radius: $btngroup-radius;
158 @include exports(button-group) {
160 @include button-group;
163 &.secondary { @include button-group-style(false, $secondary-color); }
164 &.success { @include button-group-style(false, $success-color); }
165 &.warning { @include button-group-style(false, $warning-color); }
166 &.alert { @include button-group-style(false, $alert-color); }
170 &.secondary { #{$child-selectors} { @include button-style($secondary-color, auto, $btngroup: true); } }
171 &.success { #{$child-selectors} { @include button-style($success-color, auto, $btngroup: true); } }
172 &.warning { #{$child-selectors} { @include button-style($warning-color, auto, $btngroup: true); } }
173 &.alert { #{$child-selectors} { @include button-style($alert-color, auto, $btngroup: true); } }
177 &.segmented { @include button-group-style(true);
178 &.secondary { @include button-group-style(true, $secondary-color); }
179 &.success { @include button-group-style(true, $success-color); }
180 &.warning { @include button-group-style(true, $warning-color); }
181 &.alert { @include button-group-style(true, $alert-color); }
185 &.tiny { @include button-group-size(tiny); }
186 &.small { @include button-group-size(small); }
187 &.large { @include button-group-size(large); }
188 &.expand { @include button-group-expand; }
192 #{$child-selectors} {
193 @include button-disabled;