rapido-css 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +15 -0
- data/README.md +44 -9
- data/stylesheets/_default-styles.scss +309 -138
- data/stylesheets/_functions.scss +67 -4
- data/stylesheets/_normalize.scss +39 -513
- data/stylesheets/_rapido.scss +17 -8
- data/stylesheets/_susy.scss +2 -5
- data/stylesheets/components/_alerts.scss +39 -5
- data/stylesheets/components/_breadcrumbs.scss +21 -4
- data/stylesheets/components/_button-groups.scss +42 -17
- data/stylesheets/components/_buttons.scss +69 -29
- data/stylesheets/components/_captions.scss +38 -19
- data/stylesheets/components/_close.scss +14 -3
- data/stylesheets/components/_dropdowns.scss +76 -28
- data/stylesheets/components/_forms.scss +477 -350
- data/stylesheets/components/_grids.scss +86 -0
- data/stylesheets/components/_labels.scss +26 -4
- data/stylesheets/components/_modals.scss +122 -38
- data/stylesheets/components/_navs.scss +51 -21
- data/stylesheets/components/_pager.scss +55 -10
- data/stylesheets/components/_pagination.scss +40 -25
- data/stylesheets/components/_responsive-navs.scss +141 -28
- data/stylesheets/components/_sliders.scss +45 -26
- data/stylesheets/components/_tables.scss +43 -16
- data/stylesheets/components/_tabs.scss +47 -9
- data/stylesheets/components/_type.scss +139 -73
- data/stylesheets/settings/_base.scss +73 -27
- data/stylesheets/settings/_colors.scss +43 -16
- data/stylesheets/settings/_components.scss +102 -43
- data/stylesheets/settings/_dimensions.scss +273 -92
- data/stylesheets/settings/_effects.scss +20 -12
- data/stylesheets/styleguide.md +33 -0
- data/stylesheets/utilities/_animations.scss +150 -129
- data/stylesheets/utilities/_debug.scss +29 -3
- data/stylesheets/utilities/_helper-classes.scss +135 -18
- data/stylesheets/utilities/_icon-fonts.scss +77 -80
- data/stylesheets/utilities/_mixins.scss +385 -63
- metadata +6 -13
- data/stylesheets/components/config.rb +0 -8
- data/stylesheets/settings/config.rb +0 -8
- data/stylesheets/utilities/_media-queries.scss +0 -50
- data/stylesheets/utilities/_sprites.scss +0 -22
- data/stylesheets/utilities/config.rb +0 -8
@@ -1,449 +1,576 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
/* ====================================================================================================================
|
2
|
+
|
3
|
+
Forms
|
4
|
+
|
5
|
+
Individual form controls receive default styling with `form` Results in stacked, left-aligned labels on top of form controls.
|
6
|
+
|
7
|
+
.form
|
8
|
+
+–– .form__group
|
9
|
+
| |–– .form__label
|
10
|
+
| +–– .form__controls
|
11
|
+
| |–– input
|
12
|
+
| |–– textarea
|
13
|
+
| |–– .form__select
|
14
|
+
| |–– .form__checkbox
|
15
|
+
| |–– .form__radio
|
16
|
+
| +–– .form__addon
|
17
|
+
+–– .form__actions
|
18
|
+
|
19
|
+
* **`.form__group`**: Main container of a section of the form
|
20
|
+
* **`.form__label`**: Main labels for the form.
|
21
|
+
* **`.form__controls`**: Container of inputs, buttons and addons
|
22
|
+
* **`.form__checkbox`**, **`.form__radio`**: Stacked list of checkboxes and radios.
|
23
|
+
* **`.form__checkbox.inline`**, **`.form__radio.inline`**: Inline list of checkboxes and radios.
|
24
|
+
* **`.form__select`**: Create custom style selects.
|
25
|
+
* **`.form__help--block`**: Block help text that appears under form controls.
|
26
|
+
* **`.form__help--inline`**: Inline help text that appears aside form controls.
|
27
|
+
* **`.form__actions`**: End a form with a group of actions (buttons). When placed within a `.form__actions`, the buttons will automatically indent to line up with the form controls.
|
28
|
+
|
29
|
+
Styleguide 8
|
30
|
+
|
31
|
+
==================================================================================================================== */
|
4
32
|
|
5
33
|
@if $forms {
|
6
34
|
|
7
|
-
|
8
|
-
|
9
|
-
|
35
|
+
form {
|
36
|
+
@extend .clearfix;
|
37
|
+
margin: 0 0 rhythm();
|
38
|
+
}
|
39
|
+
|
40
|
+
fieldset {
|
41
|
+
padding: 0;
|
42
|
+
margin: 0;
|
43
|
+
border: 0;
|
44
|
+
}
|
45
|
+
|
46
|
+
legend {
|
47
|
+
@include adjust-font-size-to($h5-size);
|
48
|
+
display: block;
|
49
|
+
padding: 0;
|
50
|
+
width: 100%;
|
51
|
+
font-weight: bold;
|
52
|
+
border: 0;
|
53
|
+
padding-bottom: rhythm(.5);
|
54
|
+
margin-bottom: rhythm(.5);
|
55
|
+
border-bottom: 1px solid #e5e5e5;
|
56
|
+
small {
|
57
|
+
font-size: em($base-font-size);
|
58
|
+
color: $grayLight;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
label,
|
63
|
+
input,
|
64
|
+
button,
|
65
|
+
select,
|
66
|
+
textarea {
|
67
|
+
line-height: 1em;
|
68
|
+
font-family: $base-font-family;
|
69
|
+
@include border-radius($base-border-radius);
|
70
|
+
}
|
71
|
+
|
72
|
+
.input-text,
|
73
|
+
textarea,
|
74
|
+
input[type="text"],
|
75
|
+
input[type="password"],
|
76
|
+
input[type="datetime"],
|
77
|
+
input[type="datetime-local"],
|
78
|
+
input[type="date"],
|
79
|
+
input[type="month"],
|
80
|
+
input[type="time"],
|
81
|
+
input[type="week"],
|
82
|
+
input[type="number"],
|
83
|
+
input[type="email"],
|
84
|
+
input[type="url"],
|
85
|
+
input[type="search"],
|
86
|
+
input[type="tel"],
|
87
|
+
input[type="color"] {
|
88
|
+
display: inline-block;
|
89
|
+
padding: 0 $input-padding-side;
|
90
|
+
vertical-align: middle;
|
91
|
+
height: $input-height;
|
92
|
+
border-width: $input-border;
|
93
|
+
border-style: solid;
|
94
|
+
@media \0screen { line-height: $input-height; } // Ugly IE8 Hack
|
95
|
+
@extend %input !optional;
|
96
|
+
|
97
|
+
&:focus {outline: 0;}
|
98
|
+
}
|
99
|
+
|
100
|
+
select {
|
101
|
+
color: $text-color;
|
102
|
+
display: inline-block;
|
103
|
+
}
|
104
|
+
|
105
|
+
label { display: block; }
|
106
|
+
|
107
|
+
input,
|
108
|
+
textarea {
|
109
|
+
width: 240px;
|
110
|
+
}
|
111
|
+
|
112
|
+
textarea {
|
113
|
+
height: auto;
|
114
|
+
line-height: rhythm(1);
|
115
|
+
padding: $input-padding;
|
116
|
+
}
|
117
|
+
|
118
|
+
|
119
|
+
input[type="radio"],
|
120
|
+
input[type="checkbox"] {
|
121
|
+
margin: em(1px) 0 0;
|
122
|
+
}
|
123
|
+
|
124
|
+
input[type="file"],
|
125
|
+
input[type="image"],
|
126
|
+
input[type="submit"],
|
127
|
+
input[type="reset"],
|
128
|
+
input[type="button"],
|
129
|
+
input[type="radio"],
|
130
|
+
input[type="checkbox"] {
|
131
|
+
width: auto;
|
132
|
+
}
|
133
|
+
|
134
|
+
select,
|
135
|
+
.form__select {
|
136
|
+
width: 240px;
|
137
|
+
}
|
138
|
+
|
139
|
+
select[multiple],
|
140
|
+
select[size] {
|
141
|
+
height: auto;
|
142
|
+
}
|
143
|
+
|
144
|
+
|
145
|
+
input,
|
146
|
+
textarea {
|
147
|
+
@include placeholder();
|
148
|
+
}
|
149
|
+
|
150
|
+
input[disabled],
|
151
|
+
select[disabled],
|
152
|
+
textarea[disabled],
|
153
|
+
input[readonly],
|
154
|
+
select[readonly],
|
155
|
+
textarea[readonly] {
|
156
|
+
cursor: not-allowed;
|
157
|
+
}
|
158
|
+
input[type="radio"][disabled],
|
159
|
+
input[type="checkbox"][disabled],
|
160
|
+
input[type="radio"][readonly],
|
161
|
+
input[type="checkbox"][readonly] {
|
162
|
+
background-color: transparent;
|
163
|
+
}
|
164
|
+
input:focus:invalid,
|
165
|
+
textarea:focus:invalid,
|
166
|
+
select:focus:invalid {
|
167
|
+
color: #b94a48;
|
168
|
+
border-color: #ee5f5b;
|
169
|
+
&:focus {
|
170
|
+
border-color: darken(#ee5f5b, 10%);
|
171
|
+
}
|
172
|
+
}
|
173
|
+
// }
|
10
174
|
|
11
|
-
.form {
|
12
|
-
@extend .clearfix;
|
13
|
-
margin: 0 0 em($base-line-height);
|
14
175
|
|
15
|
-
fieldset {
|
16
|
-
padding: 0;
|
17
|
-
margin: 0;
|
18
|
-
border: 0;
|
19
|
-
}
|
20
176
|
|
21
|
-
|
22
|
-
@include adjust-font-size-to($h5-size);
|
23
|
-
display: block;
|
24
|
-
padding: 0;
|
25
|
-
width: 100%;
|
26
|
-
font-weight: bold;
|
27
|
-
border: 0;
|
28
|
-
padding-bottom: rhythm(.5);
|
29
|
-
margin-bottom: rhythm(.5);
|
30
|
-
border-bottom: 1px solid #e5e5e5;
|
31
|
-
small {
|
32
|
-
font-size: em($base-font-size);
|
33
|
-
color: $grayLight;
|
34
|
-
}
|
35
|
-
}
|
177
|
+
.form__group + .form__group { margin-top: em($control-margin-bottom); }
|
36
178
|
|
37
|
-
|
38
|
-
input,
|
39
|
-
// button,
|
40
|
-
select,
|
41
|
-
textarea {
|
42
|
-
line-height: 1em;
|
43
|
-
font-family: $base-font-family;
|
44
|
-
@include border-radius($base-border-radius);
|
45
|
-
}
|
179
|
+
.form__controls { @extend .clearfix; }
|
46
180
|
|
47
|
-
|
48
|
-
textarea,
|
49
|
-
input[type="text"],
|
50
|
-
input[type="password"],
|
51
|
-
input[type="datetime"],
|
52
|
-
input[type="datetime-local"],
|
53
|
-
input[type="date"],
|
54
|
-
input[type="month"],
|
55
|
-
input[type="time"],
|
56
|
-
input[type="week"],
|
57
|
-
input[type="number"],
|
58
|
-
input[type="email"],
|
59
|
-
input[type="url"],
|
60
|
-
input[type="search"],
|
61
|
-
input[type="tel"],
|
62
|
-
input[type="color"] {
|
63
|
-
display: inline-block;
|
64
|
-
padding: 0 $input-padding-side;
|
65
|
-
// padding: $input-padding;
|
66
|
-
vertical-align: middle;
|
67
|
-
height: $input-height;
|
68
|
-
border-width: $input-border;
|
69
|
-
border-style: solid;
|
70
|
-
line-height /*\**/: $input-height \9; // Ugly IE8 Hack
|
71
|
-
@extend %input !optional;
|
181
|
+
/* --------------------------------------------------------------------------------------------------------------------
|
72
182
|
|
73
|
-
|
74
|
-
}
|
183
|
+
Labels
|
75
184
|
|
76
|
-
|
77
|
-
color: $text-color;
|
78
|
-
display: inline-block;
|
79
|
-
}
|
185
|
+
Main labels for the form using `.form__label`
|
80
186
|
|
81
|
-
|
187
|
+
Markup: <label class="form__label">Label</label>
|
82
188
|
|
83
|
-
|
84
|
-
textarea {
|
85
|
-
width: 240px;
|
86
|
-
}
|
189
|
+
Styleguide 8.1
|
87
190
|
|
88
|
-
|
89
|
-
height: auto;
|
90
|
-
line-height: rhythm(1);
|
91
|
-
padding: $input-padding;
|
92
|
-
}
|
191
|
+
-------------------------------------------------------------------------------------------------------------------- */
|
93
192
|
|
193
|
+
.form__label {
|
194
|
+
font-weight: bold;
|
195
|
+
margin-bottom: em($label-margin-bottom);
|
196
|
+
cursor: auto;
|
197
|
+
}
|
94
198
|
|
95
|
-
input[type="radio"],
|
96
|
-
input[type="checkbox"] {
|
97
|
-
margin: em(1px) 0 0;
|
98
|
-
}
|
99
199
|
|
100
|
-
|
101
|
-
input[type="image"],
|
102
|
-
input[type="submit"],
|
103
|
-
input[type="reset"],
|
104
|
-
input[type="button"],
|
105
|
-
input[type="radio"],
|
106
|
-
input[type="checkbox"] {
|
107
|
-
width: auto;
|
108
|
-
}
|
200
|
+
/* --------------------------------------------------------------------------------------------------------------------
|
109
201
|
|
110
|
-
|
111
|
-
.form__select {
|
112
|
-
width: 240px;
|
113
|
-
}
|
202
|
+
Radio & Checkbox
|
114
203
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
204
|
+
Markup:
|
205
|
+
<div class="form__controls">
|
206
|
+
<label class="form__radio {$modifiers}">
|
207
|
+
<input type="radio" value="option1" checked> Option one is this</label>
|
208
|
+
<label class="form__radio {$modifiers}">
|
209
|
+
<input type="radio" value="option2"> Option two can be something else </label>
|
210
|
+
</div>
|
211
|
+
</div>
|
119
212
|
|
213
|
+
.inline - Inline alignment with `.inline`
|
120
214
|
|
121
|
-
|
122
|
-
textarea {
|
123
|
-
@include placeholder();
|
124
|
-
}
|
215
|
+
Styleguide 8.2
|
125
216
|
|
126
|
-
|
127
|
-
// ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
|
128
|
-
input[disabled],
|
129
|
-
select[disabled],
|
130
|
-
textarea[disabled],
|
131
|
-
input[readonly],
|
132
|
-
select[readonly],
|
133
|
-
textarea[readonly] {
|
134
|
-
cursor: not-allowed;
|
135
|
-
}
|
136
|
-
input[type="radio"][disabled],
|
137
|
-
input[type="checkbox"][disabled],
|
138
|
-
input[type="radio"][readonly],
|
139
|
-
input[type="checkbox"][readonly] {
|
140
|
-
background-color: transparent;
|
141
|
-
}
|
142
|
-
input:focus:invalid,
|
143
|
-
textarea:focus:invalid,
|
144
|
-
select:focus:invalid {
|
145
|
-
color: #b94a48;
|
146
|
-
border-color: #ee5f5b;
|
147
|
-
&:focus {
|
148
|
-
border-color: darken(#ee5f5b, 10%);
|
149
|
-
}
|
150
|
-
}
|
151
|
-
}
|
217
|
+
-------------------------------------------------------------------------------------------------------------------- */
|
152
218
|
|
219
|
+
.form__radio,
|
220
|
+
.form__checkbox,
|
221
|
+
.form__select {
|
222
|
+
min-height: em($base-line-height);
|
223
|
+
padding-left: em($checkbox-padding-left);
|
224
|
+
font-weight: normal;
|
225
|
+
cursor: pointer;
|
226
|
+
display: block;
|
227
|
+
}
|
153
228
|
|
154
|
-
|
155
|
-
// Labels
|
156
|
-
// --------------------------------------------------------------------------------------------------------------------
|
229
|
+
.form__select {padding-left: 0;}
|
157
230
|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
231
|
+
.form__radio input[type="radio"],
|
232
|
+
.form__checkbox input[type="checkbox"] {
|
233
|
+
float: left;
|
234
|
+
margin-left: -20px;
|
235
|
+
}
|
236
|
+
.form__radio.inline,
|
237
|
+
.form__checkbox.inline {
|
238
|
+
display: inline-block;
|
239
|
+
vertical-align: middle;
|
240
|
+
}
|
241
|
+
.form__radio.inline + .form__radio.inline,
|
242
|
+
.form__checkbox.inline + .form__checkbox.inline {
|
243
|
+
margin-left: 20px;
|
244
|
+
}
|
163
245
|
|
164
|
-
|
165
|
-
// Radio & Checkbox
|
166
|
-
// --------------------------------------------------------------------------------------------------------------------
|
246
|
+
/* --------------------------------------------------------------------------------------------------------------------
|
167
247
|
|
168
|
-
|
169
|
-
.form__checkbox,
|
170
|
-
.form__select {
|
171
|
-
min-height: em($base-line-height);
|
172
|
-
padding-left: em($checkbox-padding-left);
|
173
|
-
font-weight: normal;
|
174
|
-
cursor: pointer;
|
175
|
-
}
|
248
|
+
Custom Select
|
176
249
|
|
177
|
-
|
250
|
+
Add custom styling to a select element wrapping the `<select>` with a `<span>` with class `.form__select`.
|
178
251
|
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
.form__radio.inline + .form__radio.inline,
|
190
|
-
.form__checkbox.inline + .form__checkbox.inline {
|
191
|
-
margin-left: 20px;
|
192
|
-
}
|
252
|
+
Markup:
|
253
|
+
<span class="form__select">
|
254
|
+
<select>
|
255
|
+
<option>1</option>
|
256
|
+
<option>2</option>
|
257
|
+
<option>3</option>
|
258
|
+
<option>4</option>
|
259
|
+
<option>5</option>
|
260
|
+
</select>
|
261
|
+
</span>
|
193
262
|
|
263
|
+
Styleguide 8.3
|
194
264
|
|
195
|
-
|
196
|
-
// Custom Select
|
197
|
-
// --------------------------------------------------------------------------------------------------------------------
|
265
|
+
-------------------------------------------------------------------------------------------------------------------- */
|
198
266
|
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
267
|
+
.form__select {
|
268
|
+
@extend %caret !optional;
|
269
|
+
@include border-radius(3px);
|
270
|
+
border-style: solid;
|
271
|
+
border-width: $input-border;
|
272
|
+
cursor: pointer;
|
273
|
+
display: inline-block;
|
274
|
+
height: $input-height;
|
275
|
+
line-height: 1em;
|
276
|
+
position: relative;
|
277
|
+
width: 240px;
|
278
|
+
|
279
|
+
select {
|
280
|
+
@include appearance(none);
|
281
|
+
background-color:transparent;
|
282
|
+
background-image:none;
|
283
|
+
border:none;
|
284
|
+
box-shadow:none;
|
204
285
|
cursor: pointer;
|
205
|
-
|
206
|
-
height: $input-height;
|
207
|
-
line-height: 1em;
|
286
|
+
padding: $input-padding;
|
208
287
|
position: relative;
|
209
|
-
width:
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
background-color:transparent;
|
214
|
-
background-image:none;
|
215
|
-
border:none;
|
216
|
-
box-shadow:none;
|
217
|
-
cursor: pointer;
|
218
|
-
padding: $input-padding;
|
219
|
-
position: relative;
|
220
|
-
width:100%;
|
221
|
-
z-index: 3;
|
222
|
-
line-height: 1em;
|
223
|
-
}
|
288
|
+
width:100%;
|
289
|
+
z-index: 3;
|
290
|
+
line-height: 1em;
|
291
|
+
}
|
224
292
|
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
293
|
+
&:after {
|
294
|
+
@include position(absolute, em($input-padding-top) em($input-padding-side) 0 0);
|
295
|
+
display: block;
|
296
|
+
}
|
229
297
|
|
230
|
-
|
298
|
+
@extend %select !optional;
|
231
299
|
|
232
|
-
|
300
|
+
}
|
233
301
|
|
234
302
|
|
235
|
-
// ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
|
236
|
-
// Help
|
237
|
-
// --------------------------------------------------------------------------------------------------------------------
|
238
303
|
|
239
|
-
|
240
|
-
.form__help--inline {
|
241
|
-
color: lighten($text-color, 15%);
|
242
|
-
}
|
243
|
-
.form__help--block {
|
244
|
-
display: block;
|
245
|
-
padding: rhythm(.5) 0 0;
|
246
|
-
}
|
247
|
-
.form__help--inline {
|
248
|
-
@include inline-block();
|
249
|
-
vertical-align: middle;
|
250
|
-
padding-left: 5px;
|
251
|
-
}
|
304
|
+
/* --------------------------------------------------------------------------------------------------------------------
|
252
305
|
|
306
|
+
Help
|
253
307
|
|
254
|
-
|
255
|
-
// Addon
|
256
|
-
// --------------------------------------------------------------------------------------------------------------------
|
308
|
+
Add an help text block
|
257
309
|
|
258
|
-
|
259
|
-
display: inline-block;
|
260
|
-
width: auto;
|
261
|
-
min-width: em(16px);
|
262
|
-
padding: $input-padding;
|
263
|
-
line-height: 1em;
|
264
|
-
font-weight: normal;
|
265
|
-
float: left;
|
266
|
-
height: $input-height;
|
267
|
-
text-align: center;
|
268
|
-
border-width: $input-border;
|
269
|
-
border-style: solid;
|
270
|
-
@extend %input-addon !optional;
|
271
|
-
}
|
310
|
+
**Block Help**
|
272
311
|
|
312
|
+
<div class="form__controls">
|
313
|
+
<input type="text">
|
314
|
+
<span class="form__help--block">Help text</span>
|
315
|
+
</div>
|
273
316
|
|
274
|
-
|
275
|
-
// Group & Controls
|
276
|
-
// --------------------------------------------------------------------------------------------------------------------
|
317
|
+
**Help Inline**
|
277
318
|
|
278
|
-
|
279
|
-
|
319
|
+
<div class="form__controls">
|
320
|
+
<input type="text">
|
321
|
+
<span class="form__help--inline">Help text</span>
|
322
|
+
</div>
|
280
323
|
|
324
|
+
Styleguide 8.4
|
281
325
|
|
282
|
-
|
283
|
-
|
284
|
-
|
326
|
+
-------------------------------------------------------------------------------------------------------------------- */
|
327
|
+
|
328
|
+
.form__help--block,
|
329
|
+
.form__help--inline {
|
330
|
+
color: lighten($text-color, 15%);
|
331
|
+
}
|
332
|
+
.form__help--block {
|
333
|
+
display: block;
|
334
|
+
padding: rhythm(.5) 0 0;
|
335
|
+
}
|
336
|
+
.form__help--inline {
|
337
|
+
@include inline-block();
|
338
|
+
vertical-align: middle;
|
339
|
+
padding-left: 5px;
|
340
|
+
}
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
/* --------------------------------------------------------------------------------------------------------------------
|
345
|
+
|
346
|
+
Append & Prepend
|
347
|
+
|
348
|
+
Markup:
|
349
|
+
<div class="form__controls form__controls--multi">
|
350
|
+
<span class="form__addon">$</span>
|
351
|
+
<input type="text">
|
352
|
+
<span class="form__addon">.00</span>
|
353
|
+
</div>
|
354
|
+
|
355
|
+
Styleguide 8.5
|
356
|
+
|
357
|
+
-------------------------------------------------------------------------------------------------------------------- */
|
358
|
+
|
359
|
+
.form__addon {
|
360
|
+
display: inline-block;
|
361
|
+
width: auto;
|
362
|
+
min-width: em(16px);
|
363
|
+
padding: $input-padding;
|
364
|
+
line-height: 1em;
|
365
|
+
font-weight: normal;
|
366
|
+
float: left;
|
367
|
+
height: $input-height;
|
368
|
+
text-align: center;
|
369
|
+
border-width: $input-border;
|
370
|
+
border-style: solid;
|
371
|
+
@extend %input-addon !optional;
|
372
|
+
}
|
373
|
+
|
374
|
+
.form__controls--multi {
|
375
|
+
margin-left: $input-border;
|
376
|
+
|
377
|
+
> [type],
|
378
|
+
> [class] {
|
379
|
+
@include border-radius(0);
|
380
|
+
float: left;
|
381
|
+
margin-left: -$input-border;
|
382
|
+
|
383
|
+
&:first-child { @include border-radius($base-border-radius 0 0 $base-border-radius); }
|
384
|
+
&:last-child { @include border-radius(0 $base-border-radius $base-border-radius 0); }
|
385
|
+
}
|
285
386
|
|
286
|
-
.
|
287
|
-
|
288
|
-
margin-top: rhythm(1);
|
289
|
-
margin-bottom: rhythm(1);
|
290
|
-
border-top: 1px solid #e5e5e5;
|
291
|
-
clear: both;
|
292
|
-
@extend .clearfix;
|
387
|
+
> ul.btn-group + * {
|
388
|
+
margin-left: -($input-border * 2);
|
293
389
|
}
|
294
390
|
|
391
|
+
> [type] {
|
392
|
+
position: relative;
|
393
|
+
z-index: 2;
|
394
|
+
}
|
295
395
|
|
296
|
-
|
297
|
-
// Append & Prepend
|
298
|
-
// --------------------------------------------------------------------------------------------------------------------
|
396
|
+
}
|
299
397
|
|
300
|
-
.form__controls--multi {
|
301
|
-
margin-left: $input-border;
|
302
398
|
|
303
|
-
|
304
|
-
> [class] {
|
305
|
-
@include border-radius(0);
|
306
|
-
float: left;
|
307
|
-
margin-left: -$input-border;
|
399
|
+
/* --------------------------------------------------------------------------------------------------------------------
|
308
400
|
|
309
|
-
|
310
|
-
&:last-child { @include border-radius(0 $base-border-radius $base-border-radius 0); }
|
311
|
-
}
|
401
|
+
Form Actions
|
312
402
|
|
313
|
-
|
314
|
-
margin-left: -($input-border * 2);
|
315
|
-
}
|
403
|
+
End a form with a group of actions (buttons). When placed within a `.form__actions`, the buttons will automatically indent to line up with the form controls.
|
316
404
|
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
405
|
+
Markup:
|
406
|
+
<div class="form__actions">
|
407
|
+
<button type="submit" class="btn btn--default ">Save changes</button>
|
408
|
+
<button type="submit" class="btn btn--default btn--primary pull-right">Save changes</button>
|
409
|
+
<button type="button" class="btn btn--default btn--secondary">Cancel</button>
|
410
|
+
</div>
|
321
411
|
|
322
|
-
|
323
|
-
// ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
|
412
|
+
Styleguide 8.6
|
324
413
|
|
325
|
-
|
326
|
-
> .btn-group:first-child > li:last-child .btn { @include border-right-radius(0); }
|
327
|
-
> div.btn-group:first-child .btn { @include border-right-radius(0); }
|
414
|
+
-------------------------------------------------------------------------------------------------------------------- */
|
328
415
|
|
329
|
-
|
330
|
-
|
331
|
-
|
416
|
+
.form__actions {
|
417
|
+
padding-top: rhythm(1);
|
418
|
+
margin-top: rhythm(1);
|
419
|
+
margin-bottom: rhythm(1);
|
420
|
+
border-top: 1px solid #e5e5e5;
|
421
|
+
clear: both;
|
422
|
+
@extend .clearfix;
|
423
|
+
}
|
332
424
|
|
333
|
-
/*
|
334
|
-
// DEBUG
|
335
425
|
|
336
|
-
|
337
|
-
> .btn-group:first-child > li:last-child .btn { background: blue !important; }
|
338
|
-
> div.btn-group:first-child .btn { background: green !important; }
|
426
|
+
/* --------------------------------------------------------------------------------------------------------------------
|
339
427
|
|
340
|
-
|
341
|
-
> .btn-group:last-child > li:last-child .btn { background: yellow !important; }
|
342
|
-
> div.btn-group:last-child > .btn { background: teal !important; }
|
343
|
-
*/
|
428
|
+
Form Layouts
|
344
429
|
|
430
|
+
Markup:
|
431
|
+
<form class="form {$modifiers}">
|
432
|
+
<div class="form__group">
|
433
|
+
<label class="form__label">Label</label>
|
434
|
+
<div class="form__controls">
|
435
|
+
<input type="text" placeholder="Type something…">
|
436
|
+
</div>
|
437
|
+
</div>
|
438
|
+
<div class="form__group">
|
439
|
+
<label class="form__label">Label</label>
|
440
|
+
<div class="form__controls">
|
441
|
+
<input type="text" placeholder="Type something…">
|
442
|
+
</div>
|
443
|
+
</div>
|
444
|
+
<div class="form__group">
|
445
|
+
<label class="form__label">Label</label>
|
446
|
+
<div class="form__controls">
|
447
|
+
<input type="text" placeholder="Type something…">
|
448
|
+
</div>
|
449
|
+
</div>
|
450
|
+
<div class="form__actions">
|
451
|
+
<button type="submit" class="btn btn--default ">Save changes</button>
|
452
|
+
</div>
|
453
|
+
</form>
|
345
454
|
|
346
|
-
|
455
|
+
.form--grid - Grid aligned `.form__group` with support for responsive layout with `columns` mixin. Example of a responsive grid with 3 columns on desktop, 2 on tablets, and 1 on smartphones: **[Example code](https://gist.github.com/raffone/6091448)**
|
456
|
+
.form--aligned - Right align labels and float them to the left to make them appear on the same line as controls.
|
457
|
+
.form--inline - For left-aligned labels and inline-block controls for a compact layout. This layout doesn't support `.form__group`, `.form__addon`, `.form__actions`
|
458
|
+
|
459
|
+
Styleguide 8.7
|
347
460
|
|
461
|
+
-------------------------------------------------------------------------------------------------------------------- */
|
348
462
|
|
349
|
-
// ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
|
350
463
|
// Form Grid
|
351
464
|
// --------------------------------------------------------------------------------------------------------------------
|
352
465
|
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
// $i: 100;
|
360
|
-
// @while $i > 0 {
|
361
|
-
// [data-width="#{$i}"] { @extend %width-#{$i}; }
|
362
|
-
// $i: $i - 5;
|
363
|
-
// }
|
466
|
+
@if $forms-grid {
|
467
|
+
.form--grid {
|
468
|
+
.form__group {
|
469
|
+
min-height: $control-min-height;
|
470
|
+
margin: 0 0 em($control-margin-bottom) 0;
|
364
471
|
}
|
365
|
-
}
|
366
472
|
|
473
|
+
.form__multi { width: 100%; }
|
367
474
|
|
368
475
|
|
369
|
-
|
476
|
+
}
|
477
|
+
}
|
478
|
+
|
370
479
|
// Form Aligned
|
371
480
|
// --------------------------------------------------------------------------------------------------------------------
|
372
481
|
|
373
|
-
|
374
|
-
|
375
|
-
.form--aligned {
|
482
|
+
@if $forms-aligned {
|
376
483
|
|
377
|
-
|
378
|
-
float: left;
|
379
|
-
width: em($horizontal-offset) - em(20px);
|
380
|
-
padding-top: em($input-padding-top);
|
381
|
-
text-align: right;
|
382
|
-
}
|
484
|
+
.form--aligned {
|
383
485
|
|
384
|
-
|
486
|
+
.form__label {
|
487
|
+
float: left;
|
488
|
+
width: em($horizontal-offset) - em(20px);
|
489
|
+
padding-top: em($input-padding-top);
|
490
|
+
text-align: right;
|
491
|
+
}
|
385
492
|
|
386
|
-
|
493
|
+
.form__controls { margin-left: em($horizontal-offset); }
|
387
494
|
|
388
|
-
|
389
|
-
.form__controls > .form__checkbox:first-child {
|
390
|
-
margin-top: em($input-padding-top);
|
391
|
-
}
|
495
|
+
.form__help--block { margin-bottom: 0; }
|
392
496
|
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
497
|
+
.form__controls > .form__radio:first-child,
|
498
|
+
.form__controls > .form__checkbox:first-child {
|
499
|
+
margin-top: em($input-padding-top);
|
500
|
+
}
|
397
501
|
|
398
|
-
|
399
|
-
|
400
|
-
|
502
|
+
.form__controls > .form__radio.inline,
|
503
|
+
.form__controls > .form__checkbox.inline{
|
504
|
+
margin-top: em($input-padding-top);
|
505
|
+
}
|
401
506
|
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
float: none;
|
406
|
-
padding-top: 0;
|
407
|
-
text-align: left;
|
408
|
-
}
|
507
|
+
.form__actions {
|
508
|
+
padding-left: em($horizontal-offset);
|
509
|
+
}
|
409
510
|
|
410
|
-
|
411
|
-
|
511
|
+
@include media(palm) {
|
512
|
+
.form__label {
|
513
|
+
width: 100%;
|
514
|
+
float: none;
|
515
|
+
padding-top: 0;
|
516
|
+
text-align: left;
|
412
517
|
}
|
518
|
+
|
519
|
+
.form__controls { margin-left: 0; }
|
520
|
+
.form__actions { padding-left: 0; }
|
413
521
|
}
|
414
522
|
}
|
523
|
+
}
|
524
|
+
|
525
|
+
|
526
|
+
/* --------------------------------------------------------------------------------------------------------------------
|
527
|
+
|
528
|
+
Inline Form (semplified)
|
529
|
+
|
530
|
+
The inline layout can also be used width a samplified markup.
|
415
531
|
|
532
|
+
Markup:
|
533
|
+
<form class="form form--inline">
|
534
|
+
<label class="form__label">Label</label>
|
535
|
+
<input type="text" placeholder="Type something…">
|
536
|
+
<label class="form__label">Label</label>
|
537
|
+
<input type="text" placeholder="Type something…">
|
538
|
+
<label class="form__label">Label</label>
|
539
|
+
<input type="text" placeholder="Type something…">
|
540
|
+
<button type="submit" class="btn btn--default ">Save changes</button>
|
541
|
+
</form>
|
542
|
+
|
543
|
+
Styleguide 8.7.1
|
544
|
+
|
545
|
+
-------------------------------------------------------------------------------------------------------------------- */
|
416
546
|
|
417
|
-
// ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
|
418
547
|
// Form Inline
|
419
548
|
// --------------------------------------------------------------------------------------------------------------------
|
420
549
|
|
421
|
-
|
550
|
+
@if $forms-inline {
|
422
551
|
|
423
|
-
|
552
|
+
.form--inline {
|
424
553
|
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
554
|
+
* {
|
555
|
+
float: none;
|
556
|
+
display: inline-block;
|
557
|
+
vertical-align: middle;
|
558
|
+
margin: 0;
|
559
|
+
padding: 0;
|
560
|
+
width: auto;
|
561
|
+
}
|
431
562
|
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
}
|
563
|
+
> * + *,
|
564
|
+
> * > * + *,
|
565
|
+
.form__group {
|
566
|
+
margin: 0 0 0 em(10px);
|
567
|
+
}
|
438
568
|
|
439
|
-
|
440
|
-
|
441
|
-
float: left;
|
442
|
-
margin-right: em(4px);
|
443
|
-
margin-left: 0;
|
444
|
-
}
|
569
|
+
.form__actions {
|
570
|
+
border: 0;
|
445
571
|
}
|
446
|
-
}
|
447
572
|
|
573
|
+
}
|
574
|
+
}
|
448
575
|
|
449
|
-
}
|
576
|
+
}
|