aboutsummaryrefslogtreecommitdiff
path: root/less/forms.less
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2013-08-12 11:07:23 -0700
committerMark Otto <[email protected]>2013-08-12 11:07:23 -0700
commitf662dff6e9c52770511e5f674579a27eeac85549 (patch)
tree1b87308cc27f78ec9c3d0bb4e77626b010f3afd7 /less/forms.less
parenta9a27d37944bbc1edb1248d22e596707af85502a (diff)
downloadbootstrap-f662dff6e9c52770511e5f674579a27eeac85549.tar.xz
bootstrap-f662dff6e9c52770511e5f674579a27eeac85549.zip
fixes #9382: inline forms now require use of .form-group for proper alignment of all form controls
Diffstat (limited to 'less/forms.less')
-rw-r--r--less/forms.less54
1 files changed, 35 insertions, 19 deletions
diff --git a/less/forms.less b/less/forms.less
index 97527fdbf..735db0495 100644
--- a/less/forms.less
+++ b/less/forms.less
@@ -293,28 +293,44 @@ textarea {
// Inline forms
//
-// Make forms appear inline(-block).
+// 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).
.form-inline {
- .form-control,
- .radio,
- .checkbox {
- display: inline-block;
- }
- // Remove default margin on radios/checkboxes that were used for stacking, and
- // then undo the floating of radios and checkboxes to match (which also avoids
- // a bug in WebKit: https://github.com/twbs/bootstrap/issues/1969).
- .radio,
- .checkbox {
- margin-top: 0;
- margin-bottom: 0;
- padding-left: 0;
- }
- .radio input[type="radio"],
- .checkbox input[type="checkbox"] {
- float: none;
- margin-left: 0;
+ // Kick in the inline
+ @media (min-width: @screen-tablet) {
+ // Inline-block all the things for "inline"
+ .form-group {
+ display: inline-block;
+ margin-bottom: 0;
+ vertical-align: middle;
+ }
+
+ // Reset form control's default 100% width
+ .form-control {
+ width: auto;
+ }
+
+ // Remove default margin on radios/checkboxes that were used for stacking, and
+ // then undo the floating of radios and checkboxes to match (which also avoids
+ // a bug in WebKit: https://github.com/twbs/bootstrap/issues/1969).
+ .radio,
+ .checkbox {
+ display: inline-block;
+ margin-top: 0;
+ margin-bottom: 0;
+ padding-left: 0;
+ }
+ .radio input[type="radio"],
+ .checkbox input[type="checkbox"] {
+ float: none;
+ margin-left: 0;
+ }
}
}