2017-10-03 05:34:56 +02:00
|
|
|
// stylelint-disable selector-no-qualifying-type
|
2016-02-06 21:28:18 +01:00
|
|
|
|
2014-01-23 04:43:08 +01:00
|
|
|
//
|
2015-04-18 20:30:29 +02:00
|
|
|
// Textual form controls
|
2013-07-26 03:29:51 +02:00
|
|
|
//
|
|
|
|
|
|
|
|
.form-control {
|
|
|
|
display: block;
|
|
|
|
width: 100%;
|
2018-07-15 23:00:23 +02:00
|
|
|
height: $input-height;
|
2017-10-19 09:05:07 +02:00
|
|
|
padding: $input-padding-y $input-padding-x;
|
2018-10-01 14:59:05 +02:00
|
|
|
font-size: $input-font-size;
|
2018-10-20 10:50:20 +02:00
|
|
|
font-weight: $input-font-weight;
|
2017-10-19 09:05:07 +02:00
|
|
|
line-height: $input-line-height;
|
2014-12-02 23:02:35 +01:00
|
|
|
color: $input-color;
|
|
|
|
background-color: $input-bg;
|
2016-02-09 07:28:11 +01:00
|
|
|
background-clip: padding-box;
|
2017-10-19 09:05:07 +02:00
|
|
|
border: $input-border-width solid $input-border-color;
|
2016-10-03 03:28:37 +02:00
|
|
|
|
2015-10-28 22:33:48 +01: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 08:11:11 +01:00
|
|
|
@include border-radius($input-border-radius, 0);
|
2016-10-03 03:28:37 +02:00
|
|
|
|
2015-07-04 03:35:46 +02:00
|
|
|
@include box-shadow($input-box-shadow);
|
2016-12-20 05:33:17 +01:00
|
|
|
@include transition($input-transition);
|
2013-07-26 03:29:51 +02:00
|
|
|
|
2015-06-19 08:56:43 +02:00
|
|
|
// Unstyle the caret on `<select>`s in IE10+.
|
|
|
|
&::-ms-expand {
|
|
|
|
background-color: transparent;
|
2015-06-19 09:14:36 +02:00
|
|
|
border: 0;
|
2015-06-19 08:56:43 +02:00
|
|
|
}
|
|
|
|
|
2013-08-05 08:05:54 +02:00
|
|
|
// Customize the `:focus` state to imitate native WebKit styles.
|
2014-12-02 23:02:35 +01:00
|
|
|
@include form-control-focus();
|
2013-07-26 03:29:51 +02:00
|
|
|
|
2013-11-02 09:35:51 +01:00
|
|
|
// Placeholder
|
2014-07-08 11:04:48 +02: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-09 04:11:40 +02:00
|
|
|
color: $input-placeholder-color;
|
2015-04-18 01:02:41 +02:00
|
|
|
// Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526.
|
|
|
|
opacity: 1;
|
2014-07-08 11:04:48 +02:00
|
|
|
}
|
2013-11-02 09:35:51 +01:00
|
|
|
|
2013-07-26 03:29:51 +02:00
|
|
|
// Disabled and read-only inputs
|
2014-02-07 11:58:10 +01: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 22:33:58 +01:00
|
|
|
&:disabled,
|
2015-08-27 14:10:32 +02: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-09 04:11:40 +02:00
|
|
|
background-color: $input-disabled-bg;
|
2015-04-18 01:02:41 +02:00
|
|
|
// iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655.
|
|
|
|
opacity: 1;
|
2013-07-26 03:29:51 +02:00
|
|
|
}
|
2015-03-01 23:11:22 +01:00
|
|
|
}
|
2013-07-26 03:29:51 +02:00
|
|
|
|
2016-02-07 03:20:27 +01:00
|
|
|
select.form-control {
|
2016-04-11 22:18:48 +02: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-07 03:20:27 +01:00
|
|
|
}
|
2013-07-26 03:29:51 +02:00
|
|
|
|
2015-04-18 01:02:41 +02:00
|
|
|
// Make file inputs better match text inputs by forcing them to new lines.
|
2015-04-18 20:30:29 +02:00
|
|
|
.form-control-file,
|
|
|
|
.form-control-range {
|
2015-04-18 01:02:41 +02:00
|
|
|
display: block;
|
2017-12-23 01:49:57 +01:00
|
|
|
width: 100%;
|
2015-04-18 01:02:41 +02:00
|
|
|
}
|
2014-02-07 11:08:32 +01:00
|
|
|
|
2015-04-23 09:51:39 +02: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 20:51:38 +01:00
|
|
|
// For use with horizontal and inline forms, when you need the label (or legend)
|
|
|
|
// text to align with the form controls.
|
2016-04-09 04:05:23 +02:00
|
|
|
.col-form-label {
|
2017-10-19 09:05:07 +02: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 20:51:38 +01:00
|
|
|
margin-bottom: 0; // Override the `<label>/<legend>` default
|
|
|
|
font-size: inherit; // Override the `<legend>` default
|
2017-10-19 09:05:07 +02:00
|
|
|
line-height: $input-line-height;
|
2015-04-23 09:51:39 +02:00
|
|
|
}
|
|
|
|
|
2016-04-09 04:05:23 +02:00
|
|
|
.col-form-label-lg {
|
2017-10-19 09:05:07 +02:00
|
|
|
padding-top: calc(#{$input-padding-y-lg} + #{$input-border-width});
|
|
|
|
padding-bottom: calc(#{$input-padding-y-lg} + #{$input-border-width});
|
2018-11-13 21:11:59 +01:00
|
|
|
font-size: $input-font-size-lg;
|
2017-10-19 09:05:07 +02:00
|
|
|
line-height: $input-line-height-lg;
|
2016-02-09 09:35:14 +01:00
|
|
|
}
|
|
|
|
|
2016-04-09 04:05:23 +02:00
|
|
|
.col-form-label-sm {
|
2017-10-19 09:05:07 +02:00
|
|
|
padding-top: calc(#{$input-padding-y-sm} + #{$input-border-width});
|
|
|
|
padding-bottom: calc(#{$input-padding-y-sm} + #{$input-border-width});
|
2018-11-13 21:11:59 +01:00
|
|
|
font-size: $input-font-size-sm;
|
2017-10-19 09:05:07 +02:00
|
|
|
line-height: $input-line-height-sm;
|
2016-02-09 09:35:14 +01:00
|
|
|
}
|
|
|
|
|
2015-04-23 09:51:39 +02:00
|
|
|
|
2017-04-28 01:35:55 +02:00
|
|
|
// Readonly controls as plain text
|
2015-04-23 10:10:14 +02:00
|
|
|
//
|
2017-04-28 01:35:55 +02: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 10:10:14 +02:00
|
|
|
|
2017-04-28 01:35:55 +02:00
|
|
|
.form-control-plaintext {
|
2017-10-22 21:19:11 +02:00
|
|
|
display: block;
|
|
|
|
width: 100%;
|
2017-10-19 09:05:07 +02:00
|
|
|
padding-top: $input-padding-y;
|
|
|
|
padding-bottom: $input-padding-y;
|
2016-12-25 23:22:03 +01:00
|
|
|
margin-bottom: 0; // match inputs if this class comes on inputs with default margins
|
2017-10-19 09:05:07 +02:00
|
|
|
line-height: $input-line-height;
|
2018-02-11 23:25:36 +01:00
|
|
|
color: $input-plaintext-color;
|
2017-09-06 22:02:57 +02:00
|
|
|
background-color: transparent;
|
2016-10-10 01:17:48 +02:00
|
|
|
border: solid transparent;
|
2017-10-19 09:05:07 +02:00
|
|
|
border-width: $input-border-width 0;
|
2015-04-23 10:10:14 +02: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 23:00:23 +02:00
|
|
|
// Repeated in `_input_group.scss` to avoid Sass extend issues.
|
2015-04-23 10:10:14 +02:00
|
|
|
|
|
|
|
.form-control-sm {
|
2018-07-15 23:00:23 +02:00
|
|
|
height: $input-height-sm;
|
2017-10-19 09:05:07 +02:00
|
|
|
padding: $input-padding-y-sm $input-padding-x-sm;
|
2018-09-18 14:35:25 +02:00
|
|
|
font-size: $input-font-size-sm;
|
2017-10-19 09:05:07 +02:00
|
|
|
line-height: $input-line-height-sm;
|
2015-08-20 21:53:41 +02:00
|
|
|
@include border-radius($input-border-radius-sm);
|
2015-04-23 10:10:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.form-control-lg {
|
2018-07-15 23:00:23 +02:00
|
|
|
height: $input-height-lg;
|
2017-10-19 09:05:07 +02:00
|
|
|
padding: $input-padding-y-lg $input-padding-x-lg;
|
2018-09-18 14:35:25 +02:00
|
|
|
font-size: $input-font-size-lg;
|
2017-10-19 09:05:07 +02:00
|
|
|
line-height: $input-line-height-lg;
|
2015-08-20 21:53:41 +02:00
|
|
|
@include border-radius($input-border-radius-lg);
|
2015-04-23 10:10:14 +02:00
|
|
|
}
|
|
|
|
|
2018-10-22 20:57:09 +02:00
|
|
|
// stylelint-disable-next-line no-duplicate-selectors
|
2018-07-15 23:00:23 +02:00
|
|
|
select.form-control {
|
|
|
|
&[size],
|
|
|
|
&[multiple] {
|
|
|
|
height: auto;
|
2016-05-09 02:31:02 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-15 23:00:23 +02:00
|
|
|
textarea.form-control {
|
|
|
|
height: auto;
|
|
|
|
}
|
2015-04-23 10:10:14 +02:00
|
|
|
|
2013-07-26 03:29:51 +02: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 23:11:22 +01:00
|
|
|
margin-bottom: $form-group-margin-bottom;
|
2013-07-26 03:29:51 +02:00
|
|
|
}
|
|
|
|
|
2016-05-10 17:24:38 +02:00
|
|
|
.form-text {
|
|
|
|
display: block;
|
2016-12-27 00:42:19 +01:00
|
|
|
margin-top: $form-text-margin-top;
|
2016-05-10 17:24:38 +02:00
|
|
|
}
|
|
|
|
|
2013-07-26 03:29:51 +02:00
|
|
|
|
2017-06-14 07:11:29 +02: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 16:15:24 +01:00
|
|
|
margin-right: -$form-grid-gutter-width / 2;
|
|
|
|
margin-left: -$form-grid-gutter-width / 2;
|
2017-06-14 07:11:29 +02:00
|
|
|
|
|
|
|
> .col,
|
|
|
|
> [class*="col-"] {
|
2018-12-05 16:15:24 +01:00
|
|
|
padding-right: $form-grid-gutter-width / 2;
|
|
|
|
padding-left: $form-grid-gutter-width / 2;
|
2017-06-14 07:11:29 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-07-26 03:29:51 +02:00
|
|
|
// Checkboxes and radios
|
|
|
|
//
|
|
|
|
// Indent the labels to position radios/checkboxes as hanging controls.
|
2012-01-05 23:11:41 +01:00
|
|
|
|
2016-05-09 01:05:27 +02:00
|
|
|
.form-check {
|
2014-06-11 05:50:58 +02:00
|
|
|
position: relative;
|
2012-11-30 22:35:20 +01:00
|
|
|
display: block;
|
2016-12-27 00:42:19 +01:00
|
|
|
padding-left: $form-check-input-gutter;
|
2016-05-09 01:05:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.form-check-input {
|
2014-06-11 05:50:58 +02:00
|
|
|
position: absolute;
|
2016-12-27 00:42:19 +01:00
|
|
|
margin-top: $form-check-input-margin-y;
|
|
|
|
margin-left: -$form-check-input-gutter;
|
2017-12-23 01:13:01 +01:00
|
|
|
|
|
|
|
&:disabled ~ .form-check-label {
|
|
|
|
color: $text-muted;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.form-check-label {
|
|
|
|
margin-bottom: 0; // Override default `<label>` bottom margin
|
2013-01-16 21:20:34 +01:00
|
|
|
}
|
2012-01-05 23:11:41 +01:00
|
|
|
|
2016-05-09 01:05:27 +02:00
|
|
|
.form-check-inline {
|
2017-12-23 01:13:01 +01:00
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
padding-left: 0; // Override base .form-check
|
2017-08-13 23:58:47 +02:00
|
|
|
margin-right: $form-check-inline-margin-x;
|
2012-01-07 08:59:22 +01:00
|
|
|
|
2017-12-23 01:13:01 +01: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 22:31:39 +02:00
|
|
|
}
|
2013-08-15 03:20:28 +02:00
|
|
|
}
|
2012-01-05 23:11:41 +01:00
|
|
|
|
2013-12-16 00:24:52 +01:00
|
|
|
|
2017-06-11 01:30:26 +02:00
|
|
|
// Form validation
|
2013-07-26 03:29:51 +02:00
|
|
|
//
|
2017-06-11 01:30:26 +02: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 10:40:27 +02:00
|
|
|
|
2019-01-11 20:16:50 +01:00
|
|
|
@each $state, $data in $form-validation-states {
|
|
|
|
@include form-validation-state($state, map-get($data, color), map-get($data, icon));
|
|
|
|
}
|
2014-07-03 07:54:56 +02:00
|
|
|
|
2013-08-03 03:48:44 +02:00
|
|
|
// Inline forms
|
|
|
|
//
|
2013-08-12 20:07:23 +02: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-03 03:48:44 +02:00
|
|
|
|
|
|
|
.form-inline {
|
2016-12-22 05:26:17 +01:00
|
|
|
display: flex;
|
|
|
|
flex-flow: row wrap;
|
2016-12-29 04:08:33 +01: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-22 05:26:17 +01: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-27 01:55:18 +01:00
|
|
|
}
|
2013-08-05 20:47:12 +02:00
|
|
|
|
2013-08-12 20:07:23 +02:00
|
|
|
// Kick in the inline
|
2014-12-29 22:40:19 +01:00
|
|
|
@include media-breakpoint-up(sm) {
|
2016-11-27 01:55:18 +01:00
|
|
|
label {
|
2016-12-22 05:26:17 +01:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2016-11-27 01:55:18 +01:00
|
|
|
margin-bottom: 0;
|
|
|
|
}
|
|
|
|
|
2013-08-12 20:07:23 +02:00
|
|
|
// Inline-block all the things for "inline"
|
2013-12-16 02:15:09 +01:00
|
|
|
.form-group {
|
2016-12-22 05:26:17 +01:00
|
|
|
display: flex;
|
|
|
|
flex: 0 0 auto;
|
|
|
|
flex-flow: row wrap;
|
2016-12-25 23:18:45 +01:00
|
|
|
align-items: center;
|
2013-08-12 20:07:23 +02:00
|
|
|
margin-bottom: 0;
|
|
|
|
}
|
2013-08-13 01:09:21 +02:00
|
|
|
|
2015-12-08 08:52:10 +01:00
|
|
|
// Allow folks to *not* use `.form-group`
|
2013-08-13 01:09:21 +02:00
|
|
|
.form-control {
|
|
|
|
display: inline-block;
|
2013-12-16 02:15:09 +01:00
|
|
|
width: auto; // Prevent labels from stacking above inputs in `.form-group`
|
2013-12-08 10:59:44 +01:00
|
|
|
vertical-align: middle;
|
2013-08-13 01:09:21 +02:00
|
|
|
}
|
2014-03-10 05:25:51 +01:00
|
|
|
|
2014-07-24 05:54:07 +02:00
|
|
|
// Make static controls behave like regular ones
|
2017-06-26 16:59:20 +02:00
|
|
|
.form-control-plaintext {
|
2014-07-24 05:54:07 +02:00
|
|
|
display: inline-block;
|
|
|
|
}
|
|
|
|
|
2018-02-02 13:25:47 +01:00
|
|
|
.input-group,
|
|
|
|
.custom-select {
|
2016-10-10 01:00:30 +02:00
|
|
|
width: auto;
|
2014-02-07 11:58:10 +01:00
|
|
|
}
|
2013-08-12 20:07:23 +02:00
|
|
|
|
|
|
|
// Remove default margin on radios/checkboxes that were used for stacking, and
|
2014-12-22 23:57:40 +01:00
|
|
|
// then undo the floating of radios and checkboxes to match.
|
2016-05-09 08:14:48 +02:00
|
|
|
.form-check {
|
2016-12-22 05:26:17 +01:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2016-11-27 01:55:18 +01:00
|
|
|
width: auto;
|
2016-05-09 08:14:48 +02:00
|
|
|
padding-left: 0;
|
|
|
|
}
|
|
|
|
.form-check-input {
|
2014-06-26 01:56:36 +02:00
|
|
|
position: relative;
|
2018-12-21 22:52:02 +01:00
|
|
|
flex-shrink: 0;
|
2016-12-27 01:11:50 +01:00
|
|
|
margin-top: 0;
|
|
|
|
margin-right: $form-check-input-margin-x;
|
2013-08-12 20:07:23 +02:00
|
|
|
margin-left: 0;
|
|
|
|
}
|
2013-12-16 02:15:09 +01:00
|
|
|
|
2016-11-27 01:55:18 +01:00
|
|
|
.custom-control {
|
2016-12-22 05:26:17 +01:00
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2016-11-27 01:55:18 +01:00
|
|
|
}
|
2017-12-23 01:13:01 +01:00
|
|
|
.custom-control-label {
|
|
|
|
margin-bottom: 0;
|
2013-12-16 02:15:09 +01:00
|
|
|
}
|
2014-12-02 23:02:35 +01:00
|
|
|
}
|
2013-08-03 03:48:44 +02:00
|
|
|
}
|