From 74a264fb98ced0228d385d601e9edd913bb1b173 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Wed, 18 Jun 2014 18:19:17 -0700 Subject: fixes #13021: add .form-group-sm/-lg --- less/forms.less | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'less/forms.less') diff --git a/less/forms.less b/less/forms.less index 2f629b0a1..ab23e68a3 100644 --- a/less/forms.less +++ b/less/forms.less @@ -507,4 +507,29 @@ input[type="checkbox"] { top: 0; right: (@grid-gutter-width / 2); } + + // Form group sizes + // + // Quick utility class for applying `.input-lg` and `.input-sm` styles to the + // inputs and labels within a `.form-group`. + .form-group-lg { + @media (min-width: @screen-sm-min) { + .control-label { + padding-top: ((@padding-large-vertical * @line-height-large) + 1); + } + } + .form-control { + &:extend(.input-lg); + } + } + .form-group-sm { + @media (min-width: @screen-sm-min) { + .control-label { + padding-top: (@padding-small-vertical + 1); + } + } + .form-control { + &:extend(.input-sm); + } + } } -- cgit v1.2.3 From 1e53dcd137e7d8c8abe26af610ebb14c26de1043 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Thu, 19 Jun 2014 18:33:41 -0700 Subject: Fixes #13872: Always apply padding to .form-control-static for that vertical alignment --- less/forms.less | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'less/forms.less') diff --git a/less/forms.less b/less/forms.less index ab23e68a3..202cdfcc4 100644 --- a/less/forms.less +++ b/less/forms.less @@ -355,7 +355,11 @@ input[type="checkbox"] { // a horizontal form layout. .form-control-static { - margin-bottom: 0; // Remove default margin from `p` + // Size it appropriately next to real form controls + padding-top: (@padding-base-vertical + 1); + padding-bottom: (@padding-base-vertical + 1); + // Remove default margin from `p` + margin-bottom: 0; } @@ -484,11 +488,6 @@ input[type="checkbox"] { .make-row(); } - .form-control-static { - padding-top: (@padding-base-vertical + 1); - padding-bottom: (@padding-base-vertical + 1); - } - // Reset spacing and right align labels, but scope to media queries so that // labels on narrow viewports stack the same as a default form example. @media (min-width: @screen-sm-min) { -- cgit v1.2.3 From e98fc373e3ef6e4a884a0142d50c765a9db5bd01 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Fri, 20 Jun 2014 13:24:14 -0700 Subject: Fixes #13872 more: add overrides for lg and sm input modifiers --- less/forms.less | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'less/forms.less') diff --git a/less/forms.less b/less/forms.less index 202cdfcc4..841762f4c 100644 --- a/less/forms.less +++ b/less/forms.less @@ -281,6 +281,26 @@ input[type="checkbox"] { } +// Static form control text +// +// Apply class to a `p` element to make any string of text align with labels in +// a horizontal form layout. + +.form-control-static { + // Size it appropriately next to real form controls + padding-top: (@padding-base-vertical + 1); + padding-bottom: (@padding-base-vertical + 1); + // Remove default margin from `p` + margin-bottom: 0; + + &.input-lg, + &.input-sm { + padding-left: 0; + padding-right: 0; + } +} + + // Form control sizing // // Build on `.form-control` with modifier classes to decrease or increase the @@ -349,20 +369,6 @@ input[type="checkbox"] { } -// Static form control text -// -// Apply class to a `p` element to make any string of text align with labels in -// a horizontal form layout. - -.form-control-static { - // Size it appropriately next to real form controls - padding-top: (@padding-base-vertical + 1); - padding-bottom: (@padding-base-vertical + 1); - // Remove default margin from `p` - margin-bottom: 0; -} - - // Help text // // Apply to any element you wish to create light text for placement immediately -- cgit v1.2.3