UNPKG

7.61 kBtext/lessView Raw
1@import (reference) './imports/global';
2@import (reference) './imports/mixins/focus';
3@import (reference) './imports/aui-theme/components/forms';
4@import 'forms-legacy';
5@import 'forms-current';
6
7form.aui {
8 margin: 20px 0 0 0;
9}
10
11form.aui:first-child {
12 margin-top: 0;
13}
14
15/* Do not give file inputs a height or width because they break horribly in certain browsers. */
16form.aui .upfile {
17 box-sizing: border-box;
18 font-family: inherit;
19 font-size: inherit;
20 margin: 5px 0;
21 padding: 0;
22}
23
24form.aui optgroup,
25form.aui option,
26form.aui optgroup option {
27 font-style: normal;
28 font-weight: normal;
29}
30
31form.aui .text[disabled],
32form.aui .password[disabled],
33form.aui .textarea[disabled],
34form.aui .select[disabled],
35form.aui .multi-select[disabled],
36form.aui .radio[disabled],
37form.aui .checkbox[disabled] {
38 cursor: not-allowed;
39}
40
41// Fixing Safari search fields (https://ecosystem.atlassian.net/browse/AUI-4062)
42form.aui .text[type=search] {
43 -webkit-appearance: textfield;
44 outline-width: 5px;
45 outline-offset: -2px;
46
47 &::-webkit-search-decoration {
48 -webkit-appearance: none;
49 }
50}
51
52/* Structural elements */
53form.aui fieldset {
54 border: 0;
55 clear: both;
56 display: block;
57 margin: 0;
58 padding: 0;
59 position: relative;
60}
61
62form.aui .field-value {
63 display: inline-block;
64 font-weight: bold;
65 padding-top: 5px;
66}
67
68/* TODO: don't support this in AUI Forms 2 */
69form.aui legend {
70 display: none;
71}
72
73form.aui .group {
74 padding-top: 0;
75}
76
77form.aui .field-group:before,
78form.aui .field-group:after,
79form.aui .group:before,
80form.aui .group:after,
81form.aui .date-select:before,
82form.aui .date-select:after {
83 content: " ";
84 display: table;
85}
86
87form.aui .field-group:after,
88form.aui .group:after,
89form.aui .date-select:after {
90 clear: both;
91}
92
93form.aui .checkbox > label,
94form.aui .radio > label {
95 font-size: @aui-font-size-medium;
96 color: @aui-text-color;
97 font-weight: @aui-font-weight-normal;
98}
99
100form.aui .checkbox > .checkbox[disabled] + label,
101form.aui .radio > .radio[disabled] + label {
102 color: @aui-form-disabled-field-label-color;
103 cursor: not-allowed;
104}
105
106form.aui .field-group .error,
107form.aui .group .error,
108form.aui .checkbox .error,
109form.aui .radio .error,
110form.aui .error {
111 clear: both;
112 color: @aui-form-error-text-color;
113 display: block;
114 margin: 5px 0 0 0;
115
116 .aui-iconfont-error {
117 margin-right: 4px;
118 }
119}
120
121form.aui .error {
122 ul {
123 padding: 0;
124 list-style: none;
125 }
126}
127
128form.aui .field-group .error:first-child,
129form.aui .checkbox .error:first-child,
130form.aui .radio .error:first-child {
131 margin-top: 0;
132}
133
134form.aui .group legend,
135form.aui .date-select legend {
136 display: block;
137}
138
139form.aui .date-select .field-group label {
140 display: none;
141}
142
143form.aui .matrix {
144 padding-top: 5px;
145}
146
147/* Buttons */
148form.aui .buttons-container {
149 box-sizing: border-box;
150 clear: both;
151 margin: 1px 0 0 0;
152 padding: 4px 0 4px 145px;
153 position: relative;
154 width: 100%;
155}
156
157/* Long Labels
158 * add long-label class to form eg: <form class="aui long-label">
159 */
160form.aui.long-label .field-group,
161form.aui.long-label .group,
162form.aui.long-label .date-select,
163form.aui.long-label .buttons-container {
164 padding-left: 250px;
165}
166
167form.aui.long-label .field-group > label,
168form.aui.long-label .field-group > aui-label,
169form.aui.long-label .group > legend {
170 margin-left: -250px;
171 width: 235px;
172}
173
174form.aui.long-label .group .field-group,
175form.aui.long-label .date-select .field-group {
176 padding-left: 0;
177}
178
179/* End Long Labels */
180
181
182/* Top Labels
183 * add top-label class to form eg: <form class="aui top-label">
184 * display all forms with top-labels for screen sizes < 768px
185 */
186.top-labels() {
187 .field-group {
188 padding-left: 0;
189 }
190
191 .field-group > label,
192 .field-group > aui-label {
193 font-size: @aui-font-size-small;
194 font-weight: @aui-font-weight-semibold;
195 display: block;
196 float: none;
197 margin: 0 0 @aui-grid / 2 0;
198 padding: 0;
199 text-align: left;
200 width: auto;
201 }
202
203 .icon-required {
204 left: 0;
205 position: relative;
206 top: 0;
207 }
208
209 .group,
210 .date-select {
211 padding-left: 0;
212 }
213
214 .group legend,
215 .date-select legend {
216 float: none;
217 margin: 0;
218 text-align: left;
219 width: auto;
220 }
221
222 .date-select label {
223 display: none;
224 }
225
226 .buttons-container {
227 padding-left: 0;
228 }
229
230}
231
232form.aui.top-label {
233 .top-labels();
234}
235
236/* End Top Labels */
237
238/* Deprecated button styling - use the new aui-button component */
239
240/* Basic Button Style */
241form.aui .button {
242 #aui.box-sizing();
243 #aui-buttons.aui-button-base();
244 #aui-buttons.aui-button-style(normal);
245 height: @aui-form-field-height;
246 line-height: 1.4285714285714;
247 margin: 0;
248 padding: @aui-button-padding-y @aui-button-padding-x;
249 text-decoration: none;
250 vertical-align: baseline;
251 white-space: nowrap;
252
253 &:focus,
254 &:hover {
255 #aui-buttons.aui-button-style(hover);
256 }
257
258 &:active,
259 &.active {
260 #aui-buttons.aui-button-style(active);
261 }
262
263 &[disabled],
264 &[disabled]:hover,
265 &[disabled]:focus,
266 &[disabled]:active {
267 #aui-buttons.aui-button-style(disabled);
268 }
269}
270
271form.aui .cancel {
272 border-radius: @aui-button-border-radius;
273 border: 0;
274 cursor: pointer;
275 font-size: @aui-button-font-size;
276 display: inline-block;
277 padding: 5px 10px;
278 vertical-align: baseline;
279}
280
281/* Create 10px effective gap; backwards compat for old and new buttons */
282/* zero font size hack to stop 4px magic number problems. */
283form.aui .buttons-container > .buttons {
284 font-size: 0;
285}
286
287/* ensure zero font size hack doesn't kill other elements. */
288form.aui .buttons-container > .buttons > * {
289 font-size: @aui-button-font-size;
290}
291
292form.aui .buttons-container .button + .button,
293form.aui .buttons-container .button + .aui-button,
294form.aui .buttons-container .aui-button + .button,
295form.aui .buttons-container .aui-button + .aui-button {
296 margin-left: 10px;
297}
298
299form.aui .buttons-container .aui-button + .aui-button-link {
300 margin-left: 9px; /* 1px diff due to border */
301}
302
303/* Message Interops */
304form.aui .aui-message + .field-group,
305form.aui .aui-message + .group,
306form.aui .aui-message + .date-select {
307 margin-top: 10px;
308}
309
310/* Deprecated */
311form.aui span.content {
312 left: -9999px;
313 position: absolute;
314 top: -9999px;
315}
316
317form.aui pre.aui-form {
318 @size: 12px;
319 background-color: @aui-form-pre-bg-color;
320 border: 1px solid @aui-border-color;
321 font-family: @aui-code-font-family;
322 font-size: @size;
323 line-height: unit(20 / @size);
324 overflow-x: auto;
325 overflow-y: visible;
326 padding: @aui-grid * 1.5;
327}
328
329// Responsive Styles
330
331#aui.responsive-small({ form.aui, form.aui.long-label {
332 .top-labels();
333} });
334
335form.aui:not(.aui-legacy-forms),
336form.aui.aui-legacy-forms {
337 /* Field widths
338 * - don't add widths to file inputs - they break horribly
339 */
340 .text,
341 .password,
342 .textarea,
343 .select,
344 .multi-select {
345 width: 100%;
346 max-width: @aui-form-field-width-default;
347 }
348
349 .short-field {
350 max-width: @aui-form-field-width-short;
351 }
352
353 .medium-field {
354 max-width: @aui-form-field-width-medium;
355 }
356
357 .medium-long-field {
358 max-width: @aui-form-field-width-medium-long;
359 }
360
361 .long-field {
362 max-width: @aui-form-field-width-long;
363 }
364
365 .full-width-field {
366 max-width: @aui-form-field-width-full;
367 }
368}