From e17e75b7574d6877facb0eadd977c025a09fd749 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sat, 26 Nov 2016 16:55:18 -0800 Subject: Update inline forms (updated docs and new flexbox styles) (#21212) * fix form-inline with flex enabled * grunt * fix alignment of labels * shorter if syntax * add new form example to docs for now * update inline form docs usage guidelines * responsive margins * better margin utils * fix sizing of .form-check * flexbox alignment of .form-check * no need to change direction * support custom controls in inline form, for default and flex modes * add example of custom select and checks to docs * remove hidden and visible label variants since we cover that in the usage guidelines at the start and include hidden labels everywhere * use property value instead of layout name * apply to all labels * add a visible label, space it out * add id --- docs/components/forms.md | 72 +++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 40 deletions(-) (limited to 'docs/components') diff --git a/docs/components/forms.md b/docs/components/forms.md index 8915c9e7b..dd3e0027f 100644 --- a/docs/components/forms.md +++ b/docs/components/forms.md @@ -274,62 +274,54 @@ The `.form-group` class is the easiest way to add some structure to forms. Its o ### Inline forms -Use the `.form-inline` class to display a series of labels, form controls, and buttons on a single horizontal row. Form controls within inline forms behave differently: +Use the `.form-inline` class to display a series of labels, form controls, and buttons on a single horizontal row. Form controls within inline forms vary slightly from their default states. -- Controls are `display: inline-block` to provide alignment control via `vertical-align` and `margin`. -- Controls receive `width: auto` to override the Bootstrap default `width: 100%`. -- Controls **only appear inline in viewports that are at least 768px wide** to account for narrow viewports on mobile devices. +- Controls are `display: inline-block` (or `flex` when enabled) to provide alignment control via `vertical-align` and `margin`. Those also means you'll have some HTML character spaces between elements by default. +- Controls and input groups receive `width: auto` to override the Bootstrap default `width: 100%`. +- Controls **only appear inline in viewports that are at least 576px wide** to account for narrow viewports on mobile devices. -Because of this, you may need to manually address the width and alignment of individual form controls. Lastly, as shown below, you should always include a `