-
Notifications
You must be signed in to change notification settings - Fork 93
/
forms.scss
1387 lines (1170 loc) · 30.7 KB
/
forms.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
@import "../pui-variables";
@import '../../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/mixins';
@import "../mixins";
/*doc
---
title: Introduction
name: 00_form_introduction
categories:
- css_components_forms
- css_all
---
<code class="pam">
<i class="fa fa-download" alt="Install the Component">
npm install @npmcorp/pui-css-forms --save
</i>
</code>
Individual form controls automatically receive some global styling.
All textual `<input>`, `<textarea>`, and `<select>` elements with
`.form-control` are set to `width: 100`%; by default.
<div class="alert alert-info">
<p class="em-high">
Wrap labels and controls in <code>.form-group</code> for optimum spacing.
</p>
</div>
*/
/*doc
---
title: Basic Forms
name: 0a_form_basic
parent: 00_form_introduction
---
```html_example
<form role="form">
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Enter email">
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
</div>
<div class="checkbox">
<label>
<input type="checkbox"> Check me out
</label>
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
```
*/
/*doc
---
title: Inline Forms
name: form_inline
categories:
- css_components_forms
- css_all
---
Add `.form-inline` to your `<form>` for left-aligned and inline-block controls.
This only applies to forms within viewports that are at least 768px wide.
<div class="alert alert-info">
<h5 class="em-high mtn">
Always add labels to every input.
</h5>
<p>
Screen readers will have trouble with your forms if you don't.
You can always hide the labels using the <code class="sg-code">.sr-only</code> class.
</p>
</div>
```html_example
<form class="styleguide-form form-inline" role="form">
<div class="form-group">
<label class="sr-only" for="exampleInputEmail5">Email address</label>
<input class="form-control" id="exampleInputEmail5" placeholder="Enter email" type="email">
</div>
<div class="form-group">
<label class="sr-only" for="exampleInputPassword2">Password</label>
<input class="form-control" id="exampleInputPassword2" placeholder="Password" type="password">
</div>
<div class="checkbox">
<label>
<input type="checkbox">
Remember me
</label>
</div>
<button class="btn btn-default" type="submit">Sign in</button>
</form>
```
*/
/*doc
---
title: Inline Forms with Labels
name: form_inline_with_labels
parent: form_inline
---
Add `.form-inline.inline-labels` to your `<form>` for left-aligned and inline-block controls with labels inline with inputs.
```html_example
<form class="styleguide-form form-inline inline-labels" role="form">
<div class="form-group">
<label for="exampleInputEmail6">Write a thing</label>
<input class="form-control" id="exampleInputEmail6" placeholder="Write a thing" type="email">
</div>
<div class="form-group">
<label for="exampleSelect">Choose a thing</label>
<select class="form-control" id="exampleSelect">
<option>thing</option>
</select>
</div>
<div class="checkbox">
<label>
<input type="checkbox">
Remember me
</label>
</div>
<button class="btn btn-default" type="submit">Sign in</button>
</form>
```
*/
/*doc
---
title: Inputs & Labels
name: form_inputs
categories:
- css_components_forms
- css_all
---
An input with the label top aligned (this is the default layout).
```html_example
<form class="styleguide-form" role="form">
<div class="form-group">
<label for="exampleInputEmail7">
<abbr title="required">*</abbr>
Email address
</label>
<input aria-required="true" class="form-control" id="exampleInputEmail7" placeholder="Enter email" required="required" type="email">
</div>
</form>
```
Use Bootstrap's predefined grid classes to align labels and groups of form controls in a horizontal
layout by adding `.form-horizontal` to the form. Doing so changes `.form-groups` to behave as grid rows, so no need for `.row`.
An input with the label left aligned
```html_example
<form class="styleguide-form form-horizontal" role="form">
<div class="form-group">
<div class="col-md-6">
<label class="control-label" for="exampleInputEmail3">
<abbr title="required">*</abbr>
Email address
</label>
</div>
<div class="col-md-18">
<input aria-required="true" class="form-control" id="exampleInputEmail3" placeholder="Enter email" required="required" type="email">
</div>
</div>
</form>
```
An input with the label right aligned (N.B., control-label class provides the right alignment):
```html_example
<form class="styleguide-form form-horizontal" role="form">
<div class="form-group">
<label class="col-md-6 control-label" for="exampleInputEmail4">
<abbr title="required">*</abbr>
Email address
</label>
<div class="col-md-18">
<input aria-required="true" class="form-control" id="exampleInputEmail4" placeholder="Enter email" required="required" type="email">
</div>
</div>
</form>
```
An unstyled input that doesn't have any of the default input styles
```html_example
<form role="form">
<label for="unstyledInput">Text Input</label>
<input class="unstyled" id="unstyledInput" placeholder="This is a text input">
</form>
```
*/
/*doc
---
title: HTML5 Controls
name: 01_form_html5_controls
parent: form_inputs
---
Examples of standard form controls supported in an example form layout.
Inputs
Most common form control, text-based input fields. Includes support for
all HTML5 types: `text`, `password`, `datetime`, `datetime-local`,
`date`, `month`, `time`, `week`, `number`, `email`, `url`, `search`,
`tel`, and `color`.
<div class="alert alert-warning">
<p class="em-high">
Inputs will only be fully styled if their type is properly declared.
</p>
</div>
```html_example
<form class="styleguide-form" role="form">
<label for="html5TextInput">Text Input</label>
<input class="form-control" id="html5TextInput" placeholder="Text input" type="text">
</form>
```
Password field
```html_example
<form class="styleguide-form" role="form">
<label for="html5PasswordInput">Password Input</label>
<input class="form-control" id="html5PasswordInput" placeholder="Password" type="password">
</form>
```
Date
```html_example
<form class="styleguide-form" role="form">
<label for="html5DateInput">Date Input</label>
<input class="form-control" id="html5DateInput" placeholder="Date" type="date">
</form>
```
Number
```html_example
<form class="styleguide-form" role="form">
<label for="html5NumberInput">Number Input</label>
<input class="form-control" id="html5NumberInput" placeholder="Number" type="number">
</form>
```
With a min/max and default starting value
```html_example
<form class="styleguide-form" role="form">
<label for="html5MinMaxInput">Min/Max Input</label>
<input class="form-control" id="html5MinMaxInput" placeholder="Number" type="number" min=0 max=2 value=1>
</form>
```
With a different increment value
```html_example
<form class="styleguide-form" role="form">
<label for="html5StepInput">Step Input</label>
<input class="form-control" id="html5StepInput" placeholder="Number" type="number" step=5>
</form>
```
Email
Use this with fields that require email addresses to pop up the correct keyboard on mobile
```html_example
<form class="styleguide-form" role="form">
<label for="html5EmailInput">Email Input</label>
<input class="form-control" id="html5EmailInput" placeholder="Email" type="email">
</form>
```
URL
Use this with fields that require urls to pop up the correct keyboard on mobile
```html_example
<form class="styleguide-form" role="form">
<label for="html5URLInput">URL Input</label>
<input class="form-control" id="html5URLInput" placeholder="URL" type="url">
</form>
```
Telephone
Use this with fields that require telephone numbers to pop up the dialpad on mobile
```html_example
<form class="styleguide-form" role="form">
<label for="html5PhoneInput">Phone Input</label>
<input class="form-control" id="html5PhoneInput" placeholder="Telephone" type="tel">
</form>
```
*/
/*doc
---
title: Sizing
name: 02_form_inputs_sizing
parent: form_inputs
---
Set heights using the form control classes `.input-lg` and `.input-sm`.
Create larger or smaller form controls that match button sizes.
```html_example_table
<label for="LargeInput">Large Input</label>
<input class="form-control input-lg" id="LargeInput" placeholder=".input-lg" type="text">
<label for="DefaultInput">Default Input</label>
<input class="form-control" id="DefaultInput" placeholder="Default Input" type="text">
<label for="SmallInput">Small Input</label>
<input class="form-control input-sm" id="SmallInput" placeholder=".input-sm" type="text">
```
Set widths using grid column classes like `.col-lg-*`.
Wrap selects in grid columns, or any custom parent element, to easily enforce desired widths.
```html_example
<form class="styleguide-form" role="form">
<div class="row">
<div class="col-md-4">
<label for="Small2WidthInput">Small 2 Width Input</label>
<input class="form-control" id="Small2WidthInput" placeholder=".col-xs-2" type="text">
</div>
<div class="col-md-6">
<label for="Small3WidthInput">Small 3 Width Input</label>
<input class="form-control" id="Small3WidthInput" placeholder=".col-xs-3" type="text">
</div>
<div class="col-md-8">
<label for="Small4WidthInput">Small 4 Width Input</label>
<input class="form-control" id="Small4WidthInput" placeholder=".col-xs-4" type="text">
</div>
</div>
</form>
```
*/
.form-group {
abbr {
float: right;
margin-left: 5px;
border-bottom: 0;
}
[class*="col"].control-label {
abbr {
float: none;
margin-right: 2px;
}
}
}
.unstyled {
background-color: transparent;
outline: none;
border: none;
}
label {
font-weight: 400; //override bootstrap
color: $neutral-3; //override bootstrap
}
// do not simplify placeholder styles, we need a separate line per browser because otherwise browser will invalidate the entire group
::-webkit-input-placeholder {
font-weight: 400;
}
:-moz-placeholder { /* Firefox 18- */
font-weight: 400;
}
::-moz-placeholder { /* Firefox 19+ */
font-weight: 400;
}
:-ms-input-placeholder {
font-weight: 400;
}
/*pending
---
title: Fancy Number Inputs
name: 03_form_fancy_number
parent: form_inputs
---
This is a fancy number input!
```html_example
<form class="styleguide-form" role="form">
<label>Instances</label>
<div class="number-fancy">
<input class="form-control" />
<ul class="list-unstyled buttons">
<li class="btn-plus">
<i class="fa fa-plus"></i>
</li>
<li class="btn-minus">
<i class="fa fa-minus"></i>
</li>
</ul>
</div>
</form>
```
*/
.number-fancy {
@extend .fancy-form-element;
@include user-select(none);
$button-width: 30px;
padding-right: $button-width + 6px;
.buttons {
position: absolute;
top: 0px;
right: 0px;
height: 100%;
li {
@include transition-pui(all, 150ms);
font-size: 12px;
background-color: white;
border: none;
width: $button-width;
height: 50%;
color: $blue-4;
text-align: center;
line-height: 20px;
&:hover {
color: $blue-2;
background-color: $neutral-9;
cursor: pointer;
}
&.btn-minus {
border-bottom-right-radius: 4px;
}
&.btn-plus {
border-top-right-radius: 4px;
}
}
}
input {
$input-margin: 5px;
height: $input-height-base - 2*$input-margin;
margin: $input-margin;
padding: 0 5px;
display: inline;
border-radius: 4px;
&:hover {
background-color: $neutral-9;
}
}
}
/*doc
---
title: Search Inputs
name: 04_form_search_input
parent: form_inputs
---
Use this input when creating a search component.
```html_example
<label for="searchInput">Search</label>
<div class="form-group form-group-search">
<input class="form-control" id="searchInput" placeholder="This is a searchbox">
<i class="fa fa-search"></i>
</div>
```
*/
.form-group-search {
position: relative;
i {
position: absolute;
left: 12px;
top: 12px;
}
input {
padding-left: 34px;
}
}
/*doc
---
title: Read-Only Inputs
name: 05_form_inputs_read_only
parent: form_inputs
---
Add the `readonly` boolean attribute on an input to prevent user input and style the input as disabled.
```html_example
<label for="ReadOnlyInput">ReadOnly</label>
<input class="form-control" type="text" id="ReadOnlyInput" placeholder="Readonly input here..." readonly>
```
*/
.form-control[readonly] {
background-color: $input-bg-disabled; //override bootstrap
}
/*doc
---
title: Selects
name: form_selects
categories:
- css_components_forms
- css_all
---
Selects are excellent to use because they will automatically
behave as expected cross browser on different devices. Prefer
them over a custom dropdown whenever possible.
```html_example
<form class="styleguide-form" role="form">
<select class="form-control">
<option>default option</option>
<option>an option</option>
<option>another option</option>
</select>
</form>
```
*/
.form-control {
@include button-shadow;
padding: 8px 14px; // override bootstrap
//-webkit-appearance: none;
position: relative;
&:hover, &:focus {
border-color: $input-border-color-hover;
}
&.active, &:active {
background-color: $input-bg-active;
}
&.disabled, &:disabled {
opacity: 0.5;
}
}
select.form-control {
color: $link-color;
font-weight: $input-font-weight;
&:hover, &:focus {
color: $input-color-hover;
}
&.active, &:active {
color: $input-color-active;
}
&.disabled, &:disabled {
color: $input-color;
}
}
/*doc
---
title: Sizing
name: 01_form_select_sizing
parent: form_selects
---
Set heights using the form control classes `.input-lg` and `.input-sm`.
Create larger or smaller form controls that match button sizes.
```html_example_table
<select class="form-control input-lg">
<option>Option 1</option>
<option>Option 2</option>
</select>
<select class="form-control">
<option>Option 1</option>
<option>Option 2</option>
</select>
<select class="form-control input-sm">
<option>Option 1</option>
<option>Option 2</option>
</select>
```
Set widths using grid column classes like `.col-lg-*`.
Wrap inputs in grid columns, or any custom parent element, to easily enforce desired widths.
```html_example
<form class="styleguide-form" role="form">
<div class="row">
<div class="col-md-4">
<label for="Small2WidthInput2">Small 2 Width Input</label>
<input class="form-control" id="Small2WidthInput2" placeholder=".col-xs-2" type="text">
</div>
<div class="col-md-6">
<label for="Small3WidthInput2">Small 3 Width Input</label>
<input class="form-control" id="Small3WidthInput2" placeholder=".col-xs-3" type="text">
</div>
<div class="col-md-8">
<label for="Small4WidthInput2">Small 4 Width Input</label>
<input class="form-control" id="Small4WidthInput2" placeholder=".col-xs-4" type="text">
</div>
</div>
</form>
```
*/
/*doc
---
title: Fancy Selects
name: 02_form_fancy_select
parent: form_selects
---
This is a fancy select!
```html_example
<form class="styleguide-form" role="form" style="width: 200px">
<label for="fancy-select">Description</label>
<div class="select-fancy">
<select class="form-control">
<option>Fancy Option 1</option>
<option>Fancy Option 2</option>
</select>
</div>
</form>
```
*/
.fancy-form-element {
box-shadow: 0 3px 0 $neutral-7;
background-color: white;
@include transition-pui();
border-radius: 4px;
position: relative;
&:hover {
box-shadow: 0 3px 0 $neutral-5;
cursor: pointer;
}
.form-control {
border: none;
box-shadow: none;
background: transparent;
background-image: none;
-webkit-appearance: none;
@include transition-pui(all, 150ms);
font-size: 16px;
font-weight: 900;
&.has-error {
border-radius: 3px;
border: 1px solid $red-3;
}
}
}
.fancy-form-element-disabled {
font-size: 16px;
font-weight: 900;
height: 30px;
margin-top: 7px;
margin-left: 7px;
}
.select-fancy {
@extend .fancy-form-element;
&:after {
z-index: 2;
content: "\f107";
font-family: FontAwesome;
position: absolute;
right: 10px;
top: 4px;
font-size: 22px;
color: $blue-4;
@include transition-pui(all, 150ms);
}
&:hover {
&:after, select {
color: $blue-2;
}
}
select {
-moz-appearance:window;
position: relative;
z-index: 3;
padding: 5px 8px;
width: 100%;
cursor: pointer;
}
select:focus {
outline: none;
}
input {
$input-margin: 5px;
height: $input-height-base - 2*$input-margin;
margin: $input-margin;
width: 75%;
padding: 0 5px;
display: inline;
border-radius: 4px;
&:hover {
background-color: $neutral-9;
}
}
.form-inline.inline-labels .form-group & select {
width: 100% !important; // Fancy select needs to override the size when inline because it is in a wrapping element
}
&.disabled {
box-shadow: none;
background-color: $neutral-10;
select {
&[disabled] {
color: $neutral-5;
background-color: transparent;
cursor: default; // Bootstrap fix https://github.com/twbs/bootstrap-sass/issues/881
}
}
&:hover {
color: $neutral-8;
background-color: $neutral-10;
}
&:after {
display: none;
}
}
}
/*doc
---
title: Text Areas
name: form_textarea
categories:
- css_components_forms
- css_all
---
Text areas are used for larger amounts of input.
```html_example
<form class="styleguide-form" role="form">
<div class="form-group">
<label for="exampleTextAreaId">Description</label>
<textarea class="form-control" id="exampleTextAreaId" rows="3"></textarea>
</div>
</form>
```
*/
/*doc
---
title: Checkboxes & Radios
name: form_checkboxes
categories:
- css_components_forms
- css_all
---
Checkboxes are for selecting one or several options in a list while radios are for selecting one option from many.
### Default (stacked)
```html_example
<form class="styleguide-form" role="form">
<div class="checkbox">
<label>
<input type="checkbox">
Option one is this and that—be sure to include why it's great
</label>
</div>
<div class="radio">
<label>
<input id="optionsRadios1" name="optionsRadios" type="radio" value="option1" checked>
Option one is this and that—be sure to include why it's great
</label>
</div>
<div class="radio">
<label>
<input id="optionsRadios2" name="optionsRadios" type="radio" value="option2">
Option two can be something else and selecting it will deselect option one
</label>
</div>
</form>
```
*/
input[type="radio"] {
margin-top: 2px; // bootstrap override: make radios line up with our small font.
}
/*doc
---
title: Inline Checkboxes & Radios
name: form_checkboxes_inline
parent: form_checkboxes
---
Use `.checkbox-inline` or `.radio-inline` class to a series of checkboxes or radios for controls appear on the same line.
```html_example
<form class="styleguide-form" role="form">
<div class="form-group">
<label class="checkbox-inline">
<input id="inlineCheckbox1" type="checkbox" value="option1">
1
</label>
<label class="checkbox-inline">
<input id="inlineCheckbox2" type="checkbox" value="option2">
2
</label>
<label class="checkbox-inline">
<input id="inlineCheckbox3" type="checkbox" value="option3">
3
</label>
</div>
<div class="form-group">
<label class="radio-inline">
<input id="inlineradio1" type="radio" value="option1">
1
</label>
<label class="radio-inline">
<input id="inlineradio2" type="radio" value="option2">
2
</label>
<label class="radio-inline">
<input id="inlineradio3" type="radio" value="option3">
3
</label>
</div>
</form>
```
*/
.form-inline.inline-labels {
.form-group {
input, select {
width: auto !important;
}
}
}
/*doc
---
title: Help Text
name: form_help_text
categories:
- css_components_forms
- css_all
---
Help text
Block level help text for form controls.
```html_example
<form class="styleguide-form" role="form">
<label for="demohelp"/>
<input class="form-control" id="demohelp" type="text">
<span class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>
</form>
```
*/
/*doc
---
title: Validations
name: form_validation
categories:
- css_components_forms
- css_all
---
To show validation errors on a field, add `.has-error` to the field's form group.
This class can be used for all types of inputs.
Error messages should use the classes `.help-block.has-error`.
```html_example_table
<form class="styleguide-form" role="form">
<div class="form-group has-error">
<label class="control-label" for="inputError">
Input with error
</label>
<input id="inputError" class="form-control" type="text">
<span class="help-block has-error">
Error help text
</span>
</div>
</form>
<form class="styleguide-form" role="form">
<div class="form-group has-error">
<div class="checkbox">
<label class="control-label">
<input type="checkbox" value="">
Checkbox which needs to be checked
</label>
<span class="help-block has-error">
Error help text
</span>
</div>
</div>
</form>
```
If you're doing client-side validation and want to show successful validation of a field,
add `.has-success` to the field's form group.
<div class="alert alert-info mbxl">
<p class="em-high">
The <code>.has-success</code> class can only be used on inputs that have a text-box.
</p>
</div>
```html_example_table
<form class="styleguide-form" role="form">
<div class="form-group has-success">
<label class="control-label" for="inputSuccess">
Input with success
</label>
<input id="inputSuccess" class="form-control" type="text">
</div>
</form>
```
*/
/* overrides bootstrap colors */
@mixin validation-label-color() {
.control-label {
color: $neutral-3;
}
}
.has-success {
position: relative;
&:before {
content: "\f00c";
display: block;
position: absolute;
bottom: 0;
right: 0;
height: $input-height-base;
width: $input-height-base;
line-height: $input-height-base;
border-top-right-radius: $input-border-radius;
border-bottom-right-radius: $input-border-radius;
color: $teal-3;
font-family: FontAwesome;
font-weight: normal;
font-style: normal;
text-decoration: inherit;