- `.input-group-label` on a text label.
- `.input-group-button` on a button. **Place the button inside this wrapper.**
+<div class="primary callout">
+ <p>This component supports flexbox mode. <a href="#">Learn how to enable flexbox mode</a>.</p>
+</div>
+
```html_example
<div class="input-group">
<span class="input-group-label">$</span>
$global-radius: 0 !default;
/// Sets the text direction of the CSS. Can be either `ltr` or `rtl`.
+/// @type Keyword
$global-text-direction: ltr !default;
+/// Enables flexbox for components that support it.
+/// @type Boolean
+$global-flexbox: true !default;
+
@if not map-has-key($foundation-palette, primary) {
@error 'In $foundation-palette, you must have a color named "primary".';
}
@mixin foundation-form-prepostfix {
$height: ($input-font-size + $form-spacing * 1.5);
-
.input-group {
- display: table;
+ display: if($global-flexbox, flex, table);
width: 100%;
margin-bottom: $form-spacing;
+ @if $global-flexbox {
+ align-items: stretch;
+ }
+
> :first-child {
border-radius: $global-radius 0 0 $global-radius;
}
}
%input-group-child {
- display: table-cell;
margin: 0;
- vertical-align: middle;
+
+ @if not $global-flexbox {
+ display: table-cell;
+ vertical-align: middle;
+ }
}
.input-group-label {
@extend %input-group-child;
text-align: center;
- width: 1%;
- height: 100%;
padding: 0 $input-prefix-padding;
background: $input-prefix-background;
color: $input-prefix-color;
border: $input-prefix-border;
+ @if $global-flexbox {
+ flex: 0 0 auto;
+ display: flex;
+ align-items: center;
+ }
+ @else {
+ width: 1%;
+ height: 100%;
+ }
+
@if has-value($input-prefix-border) {
&:first-child {
border-#{$global-right}: 0;
.input-group-field {
@extend %input-group-child;
border-radius: 0;
- height: $height;
+
+ @if $global-flexbox {
+ flex: 1 1 0px;
+ width: auto;
+ height: auto;
+ }
+ @else {
+ height: $height;
+ }
}
.input-group-button {
@extend %input-group-child;
- height: 100%;
padding-top: 0;
padding-bottom: 0;
text-align: center;
- width: 1%;
+
+ @if $global-flexbox {
+ flex: 0 0 auto;
+ }
+ @else {
+ height: 100%;
+ width: 1%;
+ }
a,
input,