-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
_input-group.scss
142 lines (118 loc) · 2.91 KB
/
_input-group.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
// Foundation for Sites
// https://get.foundation
// Licensed under MIT Open Source
////
/// @group forms
////
/// Color of labels prefixed to an input.
/// @type Color
$input-prefix-color: $black !default;
/// Background color of labels prefixed to an input.
/// @type Color
$input-prefix-background: $light-gray !default;
/// Border around labels prefixed to an input.
/// @type Border
$input-prefix-border: 1px solid $medium-gray !default;
/// Left/right padding of an pre/postfixed input label
$input-prefix-padding: 1rem !default;
@mixin foundation-form-prepostfix {
$height: ($input-font-size * $input-line-height) + (get-side($input-padding, 'top') + get-side($input-padding, 'bottom')) - rem-calc(1);
.input-group {
display: if($global-flexbox, flex, table);
width: 100%;
margin-bottom: $form-spacing;
@if $global-flexbox {
align-items: stretch;
}
> :first-child {
&, &.input-group-button > * {
border-radius: if($global-text-direction == rtl, 0 $input-radius $input-radius 0, $input-radius 0 0 $input-radius);
}
}
> :last-child {
&, &.input-group-button > * {
border-radius: if($global-text-direction == rtl, $input-radius 0 0 $input-radius, 0 $input-radius $input-radius 0);
}
}
}
%input-group-child {
margin: 0;
white-space: nowrap;
@if not $global-flexbox {
display: table-cell;
vertical-align: middle;
}
}
.input-group-label {
@extend %input-group-child;
padding: 0 $input-prefix-padding;
border: $input-prefix-border;
background: $input-prefix-background;
color: $input-prefix-color;
text-align: center;
white-space: nowrap;
@if $global-flexbox {
display: flex;
flex: 0 0 auto;
align-items: center;
}
@else {
width: 1%;
height: 100%;
}
@if has-value($input-prefix-border) {
&:first-child {
border-#{$global-right}: 0;
}
&:last-child {
border-#{$global-left}: 0;
}
}
}
.input-group-field {
@extend %input-group-child;
border-radius: 0;
@if $global-flexbox {
flex: 1 1 0px; // sass-lint:disable-line zero-unit
min-width: 0;
}
}
.input-group-button {
@extend %input-group-child;
padding-top: 0;
padding-bottom: 0;
text-align: center;
@if $global-flexbox {
display: flex;
flex: 0 0 auto;
}
@else {
width: 1%;
height: 100%;
}
a,
input,
button,
label {
@extend %input-group-child;
@if $global-flexbox {
align-self: stretch;
height: auto;
}
@else {
height: $height;
}
padding-top: 0;
padding-bottom: 0;
font-size: $input-font-size;
}
}
// Specificity bump needed to prevent override by buttons
@if not $global-flexbox {
.input-group {
.input-group-button {
display: table-cell;
}
}
}
}