Skip to content

Commit 371fbdb

Browse files
committed
.text-help is dead, long live .form-control-feedback
Uses a new more specific class, adds some basic spacing, and clarifies that this class is only for validation feedback. Clears up the help text class question in #18704 (comment) and addresses the vertical spacing in #18703.
1 parent 6140be7 commit 371fbdb

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

docs/components/forms.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,8 @@ Block help text—for below inputs or for longer lines of help text—can be eas
663663
Bootstrap includes validation styles for danger, warning, and success states on form controls.
664664

665665
- To use, add `.has-warning`, `.has-danger`, or `.has-success` to the parent element. Any `.form-control-label`, `.form-control`, and `.text-help` within that element will receive the validation styles.
666+
- To use, add `.has-warning`, `.has-danger`, or `.has-success` to the parent element. Any `.form-control-label`, `.form-control`, or custom form element will receive the validation styles.
667+
- Contextual validation text, in addition to your usual form field help text, can be added with the use of `.form-control-feedback`. This text will adapt to the parent `.has-*` class. By default it only includes a bit of `margin` for spacing and a modified `color` for each state.
666668
- Validation icons are `url()`s configured via Sass variables that are applied to `background-image` declarations for each state.
667669
- You may use your own base64 PNGs or SVGs by updating the Sass variables and recompiling.
668670
- Icons can also be disabled entirely by setting the variables to `none` or commenting out the source Sass.

scss/_forms.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ input[type="checkbox"] {
265265
//
266266
// Apply contextual and semantic states to individual form controls.
267267

268+
.form-control-feedback {
269+
margin-top: .5rem;
270+
}
271+
268272
.form-control-success,
269273
.form-control-warning,
270274
.form-control-danger {

scss/mixins/_forms.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
@mixin form-control-validation($color) {
77
// Color the label and help text
8-
.text-help,
8+
.form-control-feedback,
99
.form-control-label,
1010
.radio,
1111
.checkbox,

0 commit comments

Comments
 (0)