2017-10-02 23:34:56 -04:00
|
|
|
// stylelint-disable selector-no-qualifying-type
|
2016-02-06 15:28:18 -05:00
|
|
|
|
2014-01-22 22:43:08 -05:00
|
|
|
//
|
2015-04-18 14:30:29 -04:00
|
|
|
// Textual form controls
|
2013-07-25 21:29:51 -04:00
|
|
|
//
|
|
|
|
|
|
|
|
.form-control {
|
|
|
|
display: block;
|
|
|
|
width: 100%;
|
2018-07-15 17:00:23 -04:00
|
|
|
height: $input-height;
|
2017-10-19 03:05:07 -04:00
|
|
|
padding: $input-padding-y $input-padding-x;
|
2019-02-07 12:47:24 -05:00
|
|
|
font-family: $input-font-family;
|
2019-02-07 17:32:05 -05:00
|
|
|
@include font-size($input-font-size);
|
2018-10-20 04:50:20 -04:00
|
|
|
font-weight: $input-font-weight;
|
2017-10-19 03:05:07 -04:00
|
|
|
line-height: $input-line-height;
|
2014-12-02 17:02:35 -05:00
|
|
|
color: $input-color;
|
|
|
|
background-color: $input-bg;
|
2016-02-09 01:28:11 -05:00
|
|
|
background-clip: padding-box;
|
2017-10-19 03:05:07 -04:00
|
|
|
border: $input-border-width solid $input-border-color;
|
2016-10-02 21:28:37 -04:00
|
|
|
|
2015-10-28 17:33:48 -04:00
|
|
|
// Note: This has no effect on <select>s in some browsers, due to the limited stylability of `<select>`s in CSS.
|
2018-12-23 02:11:11 -05:00
|
|
|
@include border-radius($input-border-radius, 0);
|
2016-10-02 21:28:37 -04:00
|
|
|
|
2015-07-03 21:35:46 -04:00
|
|
|
@include box-shadow($input-box-shadow);
|
2016-12-19 23:33:17 -05:00
|
|
|
@include transition($input-transition);
|
2013-07-25 21:29:51 -04:00
|
|
|
|
2015-06-19 02:56:43 -04:00
|
|
|
// Unstyle the caret on `<select>`s in IE10+.
|
|
|
|
&::-ms-expand {
|
|
|
|
background-color: transparent;
|
2015-06-19 03:14:36 -04:00
|
|
|
border: 0;
|
2015-06-19 02:56:43 -04:00
|
|
|
}
|
|
|
|
|
2013-08-05 02:05:54 -04:00
|
|
|
// Customize the `:focus` state to imitate native WebKit styles.
|
2019-02-15 08:50:58 -05:00
|
|
|
@include form-control-focus($ignore-warning: true);
|
2013-07-25 21:29:51 -04:00
|
|
|
|
2013-11-02 04:35:51 -04:00
|
|
|
// Placeholder
|
2014-07-08 05:04:48 -04:00
|
|
|
&::placeholder {
|
(#22414) Rename for consistency `$input-bg-disabled`, `$input-bg-focus`, `$input-border-color-focus`, `$input-box-shadow-focus`, `$input-color-focus`, `$input-color-placeholder` to `$input-disabled-bg`, `$input-focus-bg`, `$input-focus-border-color`, `$input-focus-box-shadow`, `$input-focus-color`, `$input-placeholder-color`, respectively
2017-06-08 22:11:40 -04:00
|
|
|
color: $input-placeholder-color;
|
2015-04-17 19:02:41 -04:00
|
|
|
// Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526.
|
|
|
|
opacity: 1;
|
2014-07-08 05:04:48 -04:00
|
|
|
}
|
2013-11-02 04:35:51 -04:00
|
|
|
|
2013-07-25 21:29:51 -04:00
|
|
|
// Disabled and read-only inputs
|
2014-02-07 05:58:10 -05:00
|
|
|
//
|
|
|
|
// HTML5 says that controls under a fieldset > legend:first-child won't be
|
|
|
|
// disabled if the fieldset is disabled. Due to implementation difficulty, we
|
|
|
|
// don't honor that edge case; we style them as disabled anyway.
|
2014-12-22 16:33:58 -05:00
|
|
|
&:disabled,
|
2015-08-27 08:10:32 -04:00
|
|
|
&[readonly] {
|
(#22414) Rename for consistency `$input-bg-disabled`, `$input-bg-focus`, `$input-border-color-focus`, `$input-box-shadow-focus`, `$input-color-focus`, `$input-color-placeholder` to `$input-disabled-bg`, `$input-focus-bg`, `$input-focus-border-color`, `$input-focus-box-shadow`, `$input-focus-color`, `$input-placeholder-color`, respectively
2017-06-08 22:11:40 -04:00
|
|
|
background-color: $input-disabled-bg;
|
2015-04-17 19:02:41 -04:00
|
|
|
// iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655.
|
|
|
|
opacity: 1;
|
2013-07-25 21:29:51 -04:00
|
|
|
}
|
2015-03-01 17:11:22 -05:00
|
|
|
}
|
2013-07-25 21:29:51 -04:00
|
|
|
|
2016-02-06 21:20:27 -05:00
|
|
|
select.form-control {
|
2016-04-11 16:18:48 -04:00
|
|
|
&:focus::-ms-value {
|
|
|
|
// Suppress the nested default white text on blue background highlight given to
|
|
|
|
// the selected option text when the (still closed) <select> receives focus
|
|
|
|
// in IE and (under certain conditions) Edge, as it looks bad and cannot be made to
|
|
|
|
// match the appearance of the native widget.
|
|
|
|
// See https://github.com/twbs/bootstrap/issues/19398.
|
|
|
|
color: $input-color;
|
|
|
|
background-color: $input-bg;
|
|
|
|
}
|
2016-02-06 21:20:27 -05:00
|
|
|
}
|
2013-07-25 21:29:51 -04:00
|
|
|
|
2015-04-17 19:02:41 -04:00
|
|
|
// Make file inputs better match text inputs by forcing them to new lines.
|
2015-04-18 14:30:29 -04:00
|
|
|
.form-control-file,
|
|
|
|
.form-control-range {
|
2015-04-17 19:02:41 -04:00
|
|
|
display: block;
|
2017-12-22 19:49:57 -05:00
|
|
|
width: 100%;
|
2015-04-17 19:02:41 -04:00
|
|
|
}
|
2014-02-07 05:08:32 -05:00
|
|
|
|
2015-04-23 03:51:39 -04:00
|
|
|
|
|
|
|
//
|
|
|
|
// Labels
|
|
|
|
//
|
|
|
|
|
Remove .col-form-legend in favor of .col-form-label (#24932)
* chore: sync with twbs (#1)
* Make styling of grouped option buttons class-based
Referencing #23728, styling grouped radio and checkbox buttons should not require the data-toggle attribute.
* Fix installing deps in our webpack docs
* Fix nested cards on card group (#24766)
* Update popper.js to v1.12.9. (#24797)
* Don't run postcss for `dist/css/*.min.css` files. (#24676)
* Change the text color to dark on bg color warning examples (#24805)
* Remove unused file and bundle ie-emulation-modes-warning.js with docs.min.js (#24825)
* Remove the unused assets/js/ie10-viewport-bug-workaround.js.
* Combine ie-emulation-modes-warning.js with docs.min.js.
* Typos in grid.md (#24828)
Fixed typos in offsetting section of grid.md
* Fix dropup example code
* Update devDependencies. (#24829)
* Add support for fractional viewport widths (zoom/high-dpi displays) (#24299)
* Change breakpoint max- calculation to fractional values
* Update docs to reflect fractional max-width breakpoint values
* Add fractional max-width to offcanvas example
* Add documentation and SCSS comment for fractional viewport support
* Add a simple script to generate SRI hashes for our assets. (#24814)
* Allow us to run our unit test on differents jquery version
* Run karma tests in parallel.
* Update typography docs (#24863)
* closes #24450
* Rewrite custom form check backgrounds (#24697)
* Rewrite custom form check backgrounds
Previously, this was all just a background-color and background-image. When we restored the gradients though, we had two background-images competing on the same element, causing rendering glitches. This refactors that code, creating a mixin to simplify things, so we can we easily use two background-images (SVG icon and gradient) when -gradients is set to true.
Fixes #24598
* restore default vars
* Revamp custom check and radio backgrounds
Instead of applying multiple background-image's to the same element, we're adding a new ::before pseudo-element to layer the background-images. Gradients go on the .custom-control-indicator while their icons go on the ::before element. This allows us to shave some bytes from when we compile and we previously needed to redeclare the background-image for the icon if you changed the gradient.
* remove now unused mixin
* mention change in migration docs
* lets the centered modal have any height (#24803)
* Custom select updates (#24699)
* Add support for size attribute on custom selects
* Add large custom select, document it and the small variant
* fix custom select focus state
* fix custom file input focus styles
* remove empty line
* Update package.json. (#24582)
1. Use the same jQuery version in jspm
2. Update the files to only include the source and dist folders
* Use Jekyll's `smartify` filter when possible. (#24866)
* Darken outline hover color to match default button hover (#24150)
* Fix Issue #24144
Alter button-outline-variant mixin to darken hover and active background in same fashion as filled button.
* Fix Issue #24144
Filled button on hover should utilize the same color-yiq mixin so that theme buttons match
* default values, fix mixin
* rename it
* document it
* add migration note
* fixes #24728
* Remove unused CSS. (#24872)
* tab.js: do not remove fade class if there's no initial active pane
* Restore currently unused variables (#24891)
* Replace lint-vars.sh with a Node.js script. (#24860)
Also, include it in the `css` npm script since it's instant.
* Fix docs horizontal scrollbar (#24878)
* Fix docs horizontal scrollbar in Components > Modal
* Add overflow to docs example class
* Drop the handleUpdate() variant
While I understand the variant covers the "get a particular plugin instance" case from http://getbootstrap.com/docs/4.0/getting-started/javascript/#programmatic-api it seems weird that we do it here but not everywhere else in the docs (randomly checking other pages, we seem to stick to the documented methods as written on those pages). As this isn't properly explained as is, and as it adds nothing (more of a preference for authors), it would be easier to just drop the variant and stick with the documented method as outlined later on in the same page (avoids having to go off on a "why should you use this instead of that" tangent here).
* Combine path and remove variable used in one place. (#24873)
* Update devDependencies and gems. (#24876)
* Override padding on radio input label (#24899)
We could tell folks to nix the class, we could tell them to override it, or we could add another modifier of some kind to address this. None of them seem particularly useful, but the padding override feels the most approachable and clearly documentable. Added this here to close #24844.
* Update README.md (#24912)
* Work around Travis failures.
Note that we should revert this when the issue is fixed.
* Revert the Travis workaround. (#24926)
The issue has been fixed.
* add .col-form-legend-lg and .col-form-legend-sm classes
* document .col-form-legend-{size}
* trash .col-form-legend completely
One class fits all
* Update forms.md
* consolidate copy
* property order
2017-12-02 14:51:38 -05:00
|
|
|
// For use with horizontal and inline forms, when you need the label (or legend)
|
|
|
|
// text to align with the form controls.
|
2016-04-08 22:05:23 -04:00
|
|
|
.col-form-label {
|
2017-10-19 03:05:07 -04:00
|
|
|
padding-top: calc(#{$input-padding-y} + #{$input-border-width});
|
|
|
|
padding-bottom: calc(#{$input-padding-y} + #{$input-border-width});
|
Remove .col-form-legend in favor of .col-form-label (#24932)
* chore: sync with twbs (#1)
* Make styling of grouped option buttons class-based
Referencing #23728, styling grouped radio and checkbox buttons should not require the data-toggle attribute.
* Fix installing deps in our webpack docs
* Fix nested cards on card group (#24766)
* Update popper.js to v1.12.9. (#24797)
* Don't run postcss for `dist/css/*.min.css` files. (#24676)
* Change the text color to dark on bg color warning examples (#24805)
* Remove unused file and bundle ie-emulation-modes-warning.js with docs.min.js (#24825)
* Remove the unused assets/js/ie10-viewport-bug-workaround.js.
* Combine ie-emulation-modes-warning.js with docs.min.js.
* Typos in grid.md (#24828)
Fixed typos in offsetting section of grid.md
* Fix dropup example code
* Update devDependencies. (#24829)
* Add support for fractional viewport widths (zoom/high-dpi displays) (#24299)
* Change breakpoint max- calculation to fractional values
* Update docs to reflect fractional max-width breakpoint values
* Add fractional max-width to offcanvas example
* Add documentation and SCSS comment for fractional viewport support
* Add a simple script to generate SRI hashes for our assets. (#24814)
* Allow us to run our unit test on differents jquery version
* Run karma tests in parallel.
* Update typography docs (#24863)
* closes #24450
* Rewrite custom form check backgrounds (#24697)
* Rewrite custom form check backgrounds
Previously, this was all just a background-color and background-image. When we restored the gradients though, we had two background-images competing on the same element, causing rendering glitches. This refactors that code, creating a mixin to simplify things, so we can we easily use two background-images (SVG icon and gradient) when -gradients is set to true.
Fixes #24598
* restore default vars
* Revamp custom check and radio backgrounds
Instead of applying multiple background-image's to the same element, we're adding a new ::before pseudo-element to layer the background-images. Gradients go on the .custom-control-indicator while their icons go on the ::before element. This allows us to shave some bytes from when we compile and we previously needed to redeclare the background-image for the icon if you changed the gradient.
* remove now unused mixin
* mention change in migration docs
* lets the centered modal have any height (#24803)
* Custom select updates (#24699)
* Add support for size attribute on custom selects
* Add large custom select, document it and the small variant
* fix custom select focus state
* fix custom file input focus styles
* remove empty line
* Update package.json. (#24582)
1. Use the same jQuery version in jspm
2. Update the files to only include the source and dist folders
* Use Jekyll's `smartify` filter when possible. (#24866)
* Darken outline hover color to match default button hover (#24150)
* Fix Issue #24144
Alter button-outline-variant mixin to darken hover and active background in same fashion as filled button.
* Fix Issue #24144
Filled button on hover should utilize the same color-yiq mixin so that theme buttons match
* default values, fix mixin
* rename it
* document it
* add migration note
* fixes #24728
* Remove unused CSS. (#24872)
* tab.js: do not remove fade class if there's no initial active pane
* Restore currently unused variables (#24891)
* Replace lint-vars.sh with a Node.js script. (#24860)
Also, include it in the `css` npm script since it's instant.
* Fix docs horizontal scrollbar (#24878)
* Fix docs horizontal scrollbar in Components > Modal
* Add overflow to docs example class
* Drop the handleUpdate() variant
While I understand the variant covers the "get a particular plugin instance" case from http://getbootstrap.com/docs/4.0/getting-started/javascript/#programmatic-api it seems weird that we do it here but not everywhere else in the docs (randomly checking other pages, we seem to stick to the documented methods as written on those pages). As this isn't properly explained as is, and as it adds nothing (more of a preference for authors), it would be easier to just drop the variant and stick with the documented method as outlined later on in the same page (avoids having to go off on a "why should you use this instead of that" tangent here).
* Combine path and remove variable used in one place. (#24873)
* Update devDependencies and gems. (#24876)
* Override padding on radio input label (#24899)
We could tell folks to nix the class, we could tell them to override it, or we could add another modifier of some kind to address this. None of them seem particularly useful, but the padding override feels the most approachable and clearly documentable. Added this here to close #24844.
* Update README.md (#24912)
* Work around Travis failures.
Note that we should revert this when the issue is fixed.
* Revert the Travis workaround. (#24926)
The issue has been fixed.
* add .col-form-legend-lg and .col-form-legend-sm classes
* document .col-form-legend-{size}
* trash .col-form-legend completely
One class fits all
* Update forms.md
* consolidate copy
* property order
2017-12-02 14:51:38 -05:00
|
|
|
margin-bottom: 0; // Override the `<label>/<legend>` default
|
2019-02-07 17:32:05 -05:00
|
|
|
@include font-size(inherit); // Override the `<legend>` default
|
2017-10-19 03:05:07 -04:00
|
|
|
line-height: $input-line-height;
|
2015-04-23 03:51:39 -04:00
|
|
|
}
|
|
|
|
|
2016-04-08 22:05:23 -04:00
|
|
|
.col-form-label-lg {
|
2017-10-19 03:05:07 -04:00
|
|
|
padding-top: calc(#{$input-padding-y-lg} + #{$input-border-width});
|
|
|
|
padding-bottom: calc(#{$input-padding-y-lg} + #{$input-border-width});
|
2019-02-07 17:32:05 -05:00
|
|
|
@include font-size($input-font-size-lg);
|
2017-10-19 03:05:07 -04:00
|
|
|
line-height: $input-line-height-lg;
|
2016-02-09 03:35:14 -05:00
|
|
|
}
|
|
|
|
|
2016-04-08 22:05:23 -04:00
|
|
|
.col-form-label-sm {
|
2017-10-19 03:05:07 -04:00
|
|
|
padding-top: calc(#{$input-padding-y-sm} + #{$input-border-width});
|
|
|
|
padding-bottom: calc(#{$input-padding-y-sm} + #{$input-border-width});
|
2019-02-07 17:32:05 -05:00
|
|
|
@include font-size($input-font-size-sm);
|
2017-10-19 03:05:07 -04:00
|
|
|
line-height: $input-line-height-sm;
|
2016-02-09 03:35:14 -05:00
|
|
|
}
|
|
|
|
|
2015-04-23 03:51:39 -04:00
|
|
|
|
2017-04-27 19:35:55 -04:00
|
|
|
// Readonly controls as plain text
|
2015-04-23 04:10:14 -04:00
|
|
|
//
|
2017-04-27 19:35:55 -04:00
|
|
|
// Apply class to a readonly input to make it appear like regular plain
|
|
|
|
// text (without any border, background color, focus indicator)
|
2015-04-23 04:10:14 -04:00
|
|
|
|
2017-04-27 19:35:55 -04:00
|
|
|
.form-control-plaintext {
|
2017-10-22 15:19:11 -04:00
|
|
|
display: block;
|
|
|
|
width: 100%;
|
2017-10-19 03:05:07 -04:00
|
|
|
padding-top: $input-padding-y;
|
|
|
|
padding-bottom: $input-padding-y;
|
2016-12-25 17:22:03 -05:00
|
|
|
margin-bottom: 0; // match inputs if this class comes on inputs with default margins
|
2017-10-19 03:05:07 -04:00
|
|
|
line-height: $input-line-height;
|
2018-02-11 17:25:36 -05:00
|
|
|
color: $input-plaintext-color;
|
2017-09-06 16:02:57 -04:00
|
|
|
background-color: transparent;
|
2016-10-09 19:17:48 -04:00
|
|
|
border: solid transparent;
|
2017-10-19 03:05:07 -04:00
|
|
|
border-width: $input-border-width 0;
|
2015-04-23 04:10:14 -04:00
|
|
|
|
|
|
|
&.form-control-sm,
|
|
|
|
&.form-control-lg {
|
|
|
|
padding-right: 0;
|
|
|
|
padding-left: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Form control sizing
|
|
|
|
//
|
|
|
|
// Build on `.form-control` with modifier classes to decrease or increase the
|
|
|
|
// height and font-size of form controls.
|
|
|
|
//
|
2018-07-15 17:00:23 -04:00
|
|
|
// Repeated in `_input_group.scss` to avoid Sass extend issues.
|
2015-04-23 04:10:14 -04:00
|
|
|
|
|
|
|
.form-control-sm {
|
2018-07-15 17:00:23 -04:00
|
|
|
height: $input-height-sm;
|
2017-10-19 03:05:07 -04:00
|
|
|
padding: $input-padding-y-sm $input-padding-x-sm;
|
2019-02-07 17:32:05 -05:00
|
|
|
@include font-size($input-font-size-sm);
|
2017-10-19 03:05:07 -04:00
|
|
|
line-height: $input-line-height-sm;
|
2015-08-20 15:53:41 -04:00
|
|
|
@include border-radius($input-border-radius-sm);
|
2015-04-23 04:10:14 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
.form-control-lg {
|
2018-07-15 17:00:23 -04:00
|
|
|
height: $input-height-lg;
|
2017-10-19 03:05:07 -04:00
|
|
|
padding: $input-padding-y-lg $input-padding-x-lg;
|
2019-02-07 17:32:05 -05:00
|
|
|
@include font-size($input-font-size-lg);
|
2017-10-19 03:05:07 -04:00
|
|
|
line-height: $input-line-height-lg;
|
2015-08-20 15:53:41 -04:00
|
|
|
@include border-radius($input-border-radius-lg);
|
2015-04-23 04:10:14 -04:00
|
|
|
}
|
|
|
|
|
2018-10-22 14:57:09 -04:00
|
|
|
// stylelint-disable-next-line no-duplicate-selectors
|
2018-07-15 17:00:23 -04:00
|
|
|
select.form-control {
|
|
|
|
&[size],
|
|
|
|
&[multiple] {
|
|
|
|
height: auto;
|
2016-05-08 20:31:02 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-15 17:00:23 -04:00
|
|
|
textarea.form-control {
|
|
|
|
height: auto;
|
|
|
|
}
|
2015-04-23 04:10:14 -04:00
|
|
|
|
2013-07-25 21:29:51 -04:00
|
|
|
// Form groups
|
|
|
|
//
|
|
|
|
// Designed to help with the organization and spacing of vertical forms. For
|
|
|
|
// horizontal forms, use the predefined grid classes.
|
|
|
|
|
|
|
|
.form-group {
|
2015-03-01 17:11:22 -05:00
|
|
|
margin-bottom: $form-group-margin-bottom;
|
2013-07-25 21:29:51 -04:00
|
|
|
}
|
|
|
|
|
2016-05-10 11:24:38 -04:00
|
|
|
.form-text {
|
|
|
|
display: block;
|
2016-12-26 18:42:19 -05:00
|
|
|
margin-top: $form-text-margin-top;
|
2016-05-10 11:24:38 -04:00
|
|
|
}
|
|
|
|
|
2013-07-25 21:29:51 -04:00
|
|
|
|
2017-06-14 01:11:29 -04:00
|
|
|
// Form grid
|
|
|
|
//
|
|
|
|
// Special replacement for our grid system's `.row` for tighter form layouts.
|
|
|
|
|
|
|
|
.form-row {
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
2018-12-05 10:15:24 -05:00
|
|
|
margin-right: -$form-grid-gutter-width / 2;
|
|
|
|
margin-left: -$form-grid-gutter-width / 2;
|
2017-06-14 01:11:29 -04:00
|
|
|
|
|
|
|
> .col,
|
|
|
|
> [class*="col-"] {
|
2018-12-05 10:15:24 -05:00
|
|
|
padding-right: $form-grid-gutter-width / 2;
|
|
|
|
padding-left: $form-grid-gutter-width / 2;
|
2017-06-14 01:11:29 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-07-25 21:29:51 -04:00
|
|
|
// Checkboxes and radios
|
|
|
|
//
|
|
|
|
// Indent the labels to position radios/checkboxes as hanging controls.
|
2012-01-05 17:11:41 -05:00
|
|
|
|
2016-05-08 19:05:27 -04:00
|
|
|
.form-check {
|
2014-06-10 23:50:58 -04:00
|
|
|
position: relative;
|
2012-11-30 16:35:20 -05:00
|
|
|
display: block;
|
2016-12-26 18:42:19 -05:00
|
|
|
padding-left: $form-check-input-gutter;
|
2016-05-08 19:05:27 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
.form-check-input {
|
2014-06-10 23:50:58 -04:00
|
|
|
position: absolute;
|
2016-12-26 18:42:19 -05:00
|
|
|
margin-top: $form-check-input-margin-y;
|
|
|
|
margin-left: -$form-check-input-gutter;
|
2017-12-22 19:13:01 -05:00
|
|
|
|
|
|
|
&:disabled ~ .form-check-label {
|
|
|
|
color: $text-muted;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.form-check-label {
|
|
|
|
margin-bottom: 0; // Override default `<label>` bottom margin
|
2013-01-16 15:20:34 -05:00
|
|
|
}
|
2012-01-05 17:11:41 -05:00
|
|
|
|
2016-05-08 19:05:27 -04:00
|
|
|
.form-check-inline {
|
2017-12-22 19:13:01 -05:00
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
padding-left: 0; // Override base .form-check
|
2017-08-13 17:58:47 -04:00
|
|
|
margin-right: $form-check-inline-margin-x;
|
2012-01-07 02:59:22 -05:00
|
|
|
|
2017-12-22 19:13:01 -05:00
|
|
|
// Undo .form-check-input defaults and add some `margin-right`.
|
|
|
|
.form-check-input {
|
|
|
|
position: static;
|
|
|
|
margin-top: 0;
|
|
|
|
margin-right: $form-check-inline-input-margin-x;
|
|
|
|
margin-left: 0;
|
2014-06-05 16:31:39 -04:00
|
|
|
}
|
2013-08-14 21:20:28 -04:00
|
|
|
}
|
2012-01-05 17:11:41 -05:00
|
|
|
|
2013-12-15 18:24:52 -05:00
|
|
|
|
2017-06-10 19:30:26 -04:00
|
|
|
// Form validation
|
2013-07-25 21:29:51 -04:00
|
|
|
//
|
2017-06-10 19:30:26 -04:00
|
|
|
// Provide feedback to users when form field values are valid or invalid. Works
|
|
|
|
// primarily for client-side validation via scoped `:invalid` and `:valid`
|
|
|
|
// pseudo-classes but also includes `.is-invalid` and `.is-valid` classes for
|
|
|
|
// server side validation.
|
2011-09-29 04:40:27 -04:00
|
|
|
|
2019-01-11 14:16:50 -05:00
|
|
|
@each $state, $data in $form-validation-states {
|
|
|
|
@include form-validation-state($state, map-get($data, color), map-get($data, icon));
|
|
|
|
}
|
2014-07-03 01:54:56 -04:00
|
|
|
|
2013-08-02 21:48:44 -04:00
|
|
|
// Inline forms
|
|
|
|
//
|
2013-08-12 14:07:23 -04:00
|
|
|
// Make forms appear inline(-block) by adding the `.form-inline` class. Inline
|
|
|
|
// forms begin stacked on extra small (mobile) devices and then go inline when
|
|
|
|
// viewports reach <768px.
|
|
|
|
//
|
|
|
|
// Requires wrapping inputs and labels with `.form-group` for proper display of
|
|
|
|
// default HTML form controls and our custom form controls (e.g., input groups).
|
2013-08-02 21:48:44 -04:00
|
|
|
|
|
|
|
.form-inline {
|
2016-12-21 23:26:17 -05:00
|
|
|
display: flex;
|
|
|
|
flex-flow: row wrap;
|
2016-12-28 22:08:33 -05:00
|
|
|
align-items: center; // Prevent shorter elements from growing to same height as others (e.g., small buttons growing to normal sized button height)
|
2016-12-21 23:26:17 -05:00
|
|
|
|
|
|
|
// Because we use flex, the initial sizing of checkboxes is collapsed and
|
|
|
|
// doesn't occupy the full-width (which is what we want for xs grid tier),
|
|
|
|
// so we force that here.
|
|
|
|
.form-check {
|
|
|
|
width: 100%;
|
2016-11-26 19:55:18 -05:00
|
|
|
}
|
2013-08-05 14:47:12 -04:00
|
|
|
|
2013-08-12 14:07:23 -04:00
|
|
|
// Kick in the inline
|
2014-12-29 16:40:19 -05:00
|
|
|
@include media-breakpoint-up(sm) {
|
2016-11-26 19:55:18 -05:00
|
|
|
label {
|
2016-12-21 23:26:17 -05:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2016-11-26 19:55:18 -05:00
|
|
|
margin-bottom: 0;
|
|
|
|
}
|
|
|
|
|
2013-08-12 14:07:23 -04:00
|
|
|
// Inline-block all the things for "inline"
|
2013-12-15 20:15:09 -05:00
|
|
|
.form-group {
|
2016-12-21 23:26:17 -05:00
|
|
|
display: flex;
|
|
|
|
flex: 0 0 auto;
|
|
|
|
flex-flow: row wrap;
|
2016-12-25 17:18:45 -05:00
|
|
|
align-items: center;
|
2013-08-12 14:07:23 -04:00
|
|
|
margin-bottom: 0;
|
|
|
|
}
|
2013-08-12 19:09:21 -04:00
|
|
|
|
2015-12-08 02:52:10 -05:00
|
|
|
// Allow folks to *not* use `.form-group`
|
2013-08-12 19:09:21 -04:00
|
|
|
.form-control {
|
|
|
|
display: inline-block;
|
2013-12-15 20:15:09 -05:00
|
|
|
width: auto; // Prevent labels from stacking above inputs in `.form-group`
|
2013-12-08 04:59:44 -05:00
|
|
|
vertical-align: middle;
|
2013-08-12 19:09:21 -04:00
|
|
|
}
|
2014-03-10 00:25:51 -04:00
|
|
|
|
2014-07-23 23:54:07 -04:00
|
|
|
// Make static controls behave like regular ones
|
2017-06-26 10:59:20 -04:00
|
|
|
.form-control-plaintext {
|
2014-07-23 23:54:07 -04:00
|
|
|
display: inline-block;
|
|
|
|
}
|
|
|
|
|
2018-02-02 07:25:47 -05:00
|
|
|
.input-group,
|
|
|
|
.custom-select {
|
2016-10-09 19:00:30 -04:00
|
|
|
width: auto;
|
2014-02-07 05:58:10 -05:00
|
|
|
}
|
2013-08-12 14:07:23 -04:00
|
|
|
|
|
|
|
// Remove default margin on radios/checkboxes that were used for stacking, and
|
2014-12-22 17:57:40 -05:00
|
|
|
// then undo the floating of radios and checkboxes to match.
|
2016-05-09 02:14:48 -04:00
|
|
|
.form-check {
|
2016-12-21 23:26:17 -05:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2016-11-26 19:55:18 -05:00
|
|
|
width: auto;
|
2016-05-09 02:14:48 -04:00
|
|
|
padding-left: 0;
|
|
|
|
}
|
|
|
|
.form-check-input {
|
2014-06-25 19:56:36 -04:00
|
|
|
position: relative;
|
2018-12-21 16:52:02 -05:00
|
|
|
flex-shrink: 0;
|
2016-12-26 19:11:50 -05:00
|
|
|
margin-top: 0;
|
|
|
|
margin-right: $form-check-input-margin-x;
|
2013-08-12 14:07:23 -04:00
|
|
|
margin-left: 0;
|
|
|
|
}
|
2013-12-15 20:15:09 -05:00
|
|
|
|
2016-11-26 19:55:18 -05:00
|
|
|
.custom-control {
|
2016-12-21 23:26:17 -05:00
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2016-11-26 19:55:18 -05:00
|
|
|
}
|
2017-12-22 19:13:01 -05:00
|
|
|
.custom-control-label {
|
|
|
|
margin-bottom: 0;
|
2013-12-15 20:15:09 -05:00
|
|
|
}
|
2014-12-02 17:02:35 -05:00
|
|
|
}
|
2013-08-02 21:48:44 -04:00
|
|
|
}
|