From 4211f21e39631179753d6775e3ad90be05ab5f8f Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Wed, 1 Feb 2012 22:27:11 -0800 Subject: #1571: remove fixed width on file inputs --- less/forms.less | 1 + 1 file changed, 1 insertion(+) (limited to 'less/forms.less') diff --git a/less/forms.less b/less/forms.less index 9c9a9b8a9..ccf3c67fa 100644 --- a/less/forms.less +++ b/less/forms.less @@ -91,6 +91,7 @@ input[type="radio"] { // Reset the file input to browser defaults input[type="file"] { + width: auto; padding: initial; line-height: initial; border: initial; -- cgit v1.2.3 From ac98cee6092738eb431ebd4c944886358dab721f Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sat, 4 Feb 2012 18:26:04 -0800 Subject: allow alternate form layouts to hide inputs with .hide on them --- less/forms.less | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'less/forms.less') diff --git a/less/forms.less b/less/forms.less index ccf3c67fa..31442fa36 100644 --- a/less/forms.less +++ b/less/forms.less @@ -462,6 +462,10 @@ select:focus:required:invalid { display: inline-block; margin-bottom: 0; } + // Re-hide hidden elements due to specifity + .hide { + display: none; + } } .form-search label, .form-inline label, -- cgit v1.2.3 From 35fdddbc4fdd134953ce2b1e4a88047850aa47a0 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sat, 4 Feb 2012 22:55:47 -0800 Subject: correct css selector for .control-label, required in the docs but not in the CSS files --- less/forms.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'less/forms.less') diff --git a/less/forms.less b/less/forms.less index 31442fa36..48f80396e 100644 --- a/less/forms.less +++ b/less/forms.less @@ -503,7 +503,7 @@ select:focus:required:invalid { .clearfix(); } // Float the labels left - .control-group > label { + .control-label { float: left; width: 140px; padding-top: 5px; -- cgit v1.2.3 From 91475c865dd8fe224c574c1a15e8949fccdda8c0 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sun, 5 Feb 2012 02:14:25 -0800 Subject: fix #1631 by adding focus to radio buttons --- less/forms.less | 1 + 1 file changed, 1 insertion(+) (limited to 'less/forms.less') diff --git a/less/forms.less b/less/forms.less index 48f80396e..a8de0f24c 100644 --- a/less/forms.less +++ b/less/forms.less @@ -202,6 +202,7 @@ textarea:focus { outline: thin dotted \9; /* IE6-8 */ } input[type="file"]:focus, +input[type="radio"]:focus, input[type="checkbox"]:focus, select:focus { .box-shadow(none); // override for file inputs -- cgit v1.2.3 From 59b32586af807d0e4f2985ef6e927e32d8ae2df5 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sun, 5 Feb 2012 02:16:46 -0800 Subject: close #1628 to add padding to all inline checkboxes/radios --- less/forms.less | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'less/forms.less') diff --git a/less/forms.less b/less/forms.less index a8de0f24c..3f68df01c 100644 --- a/less/forms.less +++ b/less/forms.less @@ -166,9 +166,11 @@ input[type="hidden"] { } // Radios and checkboxes on same line +// TODO v3: Convert .inline to .control-inline .radio.inline, .checkbox.inline { display: inline-block; + padding-top: 5px; margin-bottom: 0; vertical-align: middle; } @@ -176,11 +178,6 @@ input[type="hidden"] { .checkbox.inline + .checkbox.inline { margin-left: 10px; // space out consecutive inline controls } -// But don't forget to remove their padding on first-child -.controls > .radio.inline:first-child, -.controls > .checkbox.inline:first-child { - padding-top: 0; -} -- cgit v1.2.3 From 2d9b3c45d3ae5b2e4055435783d0d9428353b70a Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Tue, 7 Feb 2012 00:13:52 -0800 Subject: move formfieldstate mixin to mixins.less for #1785 --- less/forms.less | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'less/forms.less') diff --git a/less/forms.less b/less/forms.less index 3f68df01c..5bce4cebd 100644 --- a/less/forms.less +++ b/less/forms.less @@ -259,33 +259,6 @@ textarea[readonly] { // FORM FIELD FEEDBACK STATES // -------------------------- -// Mixin for form field states -.formFieldState(@textColor: #555, @borderColor: #ccc, @backgroundColor: #f5f5f5) { - // Set the text color - > label, - .help-block, - .help-inline { - color: @textColor; - } - // Style inputs accordingly - input, - select, - textarea { - color: @textColor; - border-color: @borderColor; - &:focus { - border-color: darken(@borderColor, 10%); - .box-shadow(0 0 6px lighten(@borderColor, 20%)); - } - } - // Give a small background color for input-prepend/-append - .input-prepend .add-on, - .input-append .add-on { - color: @textColor; - background-color: @backgroundColor; - border-color: @textColor; - } -} // Warning .control-group.warning { .formFieldState(@warningText, @warningText, @warningBackground); -- cgit v1.2.3 From 920d9958431b3d0a08401bfbc097416bc83211bd Mon Sep 17 00:00:00 2001 From: Jeremy Martin Date: Thu, 9 Feb 2012 15:27:42 -0500 Subject: webkit legend margin fix for non-horizontal forms --- less/forms.less | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'less/forms.less') diff --git a/less/forms.less b/less/forms.less index 5bce4cebd..5fbb53c9a 100644 --- a/less/forms.less +++ b/less/forms.less @@ -459,15 +459,16 @@ select:focus:required:invalid { margin-bottom: @baseLineHeight / 2; } +// Legend collapses margin, so next element is responsible for spacing +legend + .control-group { + margin-top: @baseLineHeight; + -webkit-margin-top-collapse: separate; +} + // Horizontal-specific styles // -------------------------- .form-horizontal { - // Legend collapses margin, so we're relegated to padding - legend + .control-group { - margin-top: @baseLineHeight; - -webkit-margin-top-collapse: separate; - } // Increase spacing between groups .control-group { margin-bottom: @baseLineHeight; -- cgit v1.2.3 From 8f1db4321a35851d5b726290b2d99e7ea1ec7239 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sat, 11 Feb 2012 00:24:06 -0800 Subject: fix inline form checkbox/radios --- less/forms.less | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'less/forms.less') diff --git a/less/forms.less b/less/forms.less index 5fbb53c9a..17393b280 100644 --- a/less/forms.less +++ b/less/forms.less @@ -453,6 +453,14 @@ select:focus:required:invalid { .form-inline .input-prepend .add-on { vertical-align: middle; } +// Inline checkbox/radio labels +.form-search .radio, +.form-inline .radio, +.form-search .checkbox, +.form-inline .checkbox { + margin-bottom: 0; + vertical-align: middle; +} // Margin to space out fieldsets .control-group { -- cgit v1.2.3 From 5a3dfb72bfcf1859690c76a8ddb8457eb962bdb3 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sat, 11 Feb 2012 16:50:57 -0800 Subject: support small for legend per #1544 --- less/forms.less | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'less/forms.less') diff --git a/less/forms.less b/less/forms.less index 17393b280..f262af0db 100644 --- a/less/forms.less +++ b/less/forms.less @@ -28,6 +28,12 @@ legend { color: @grayDark; border: 0; border-bottom: 1px solid #eee; + + // Small + small { + font-size: @baseLineHeight * .75; + color: @grayLight; + } } // Set font for forms -- cgit v1.2.3 From 158419c0455ea499197f8b7917bdfe299caaac19 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sat, 11 Feb 2012 20:00:44 -0800 Subject: reset line-height for file input in ie9 --- less/forms.less | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'less/forms.less') diff --git a/less/forms.less b/less/forms.less index f262af0db..7f076aca3 100644 --- a/less/forms.less +++ b/less/forms.less @@ -122,6 +122,11 @@ input[type="file"] { line-height: 28px; } +// Reset line-height for IE +input[type="file"] { + line-height: 18px \9; +} + // Chrome on Linux and Mobile Safari need background-color select { width: 220px; // default input width + 10px of padding that doesn't get applied -- cgit v1.2.3 From b327420e524691808b59fa2d0d552e5ec65e2a45 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sat, 11 Feb 2012 20:58:10 -0800 Subject: update comment to reflect ie support --- less/forms.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'less/forms.less') diff --git a/less/forms.less b/less/forms.less index 7f076aca3..81833b064 100644 --- a/less/forms.less +++ b/less/forms.less @@ -207,7 +207,7 @@ textarea:focus { @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); .box-shadow(@shadow); outline: 0; - outline: thin dotted \9; /* IE6-8 */ + outline: thin dotted \9; /* IE6-9 */ } input[type="file"]:focus, input[type="radio"]:focus, -- cgit v1.2.3 From a9e469e75aba9edb6e4b0eb29f0a51dbef3167b7 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sun, 12 Feb 2012 14:01:58 -0800 Subject: add navbar background hover variable and fix uneditable-input with append/prepend controls --- less/forms.less | 1 + 1 file changed, 1 insertion(+) (limited to 'less/forms.less') diff --git a/less/forms.less b/less/forms.less index 81833b064..eb98f1bcb 100644 --- a/less/forms.less +++ b/less/forms.less @@ -395,6 +395,7 @@ select:focus:required:invalid { .border-radius(3px 0 0 3px); } .uneditable-input { + border-left-color: #eee; border-right-color: #ccc; } .add-on { -- cgit v1.2.3 From ce5976fb2901ec43c132fa7d517b9e2ca6041087 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sun, 12 Feb 2012 22:49:06 -0800 Subject: ensure help-block is block per #1937 --- less/forms.less | 1 + 1 file changed, 1 insertion(+) (limited to 'less/forms.less') diff --git a/less/forms.less b/less/forms.less index eb98f1bcb..81e5bb42c 100644 --- a/less/forms.less +++ b/less/forms.less @@ -327,6 +327,7 @@ select:focus:required:invalid { // --------- .help-block { + display: block; // account for any element using help-block margin-top: 5px; margin-bottom: 0; color: @grayLight; -- cgit v1.2.3 From 64ea59234f30f51ab5497830d1825c7e043a575e Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 13 Feb 2012 08:18:19 -0800 Subject: change up fonts on form elements to remove unnecessary font-family on label element, per #1950 --- less/forms.less | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'less/forms.less') diff --git a/less/forms.less b/less/forms.less index 81e5bb42c..be9dbfaa9 100644 --- a/less/forms.less +++ b/less/forms.less @@ -42,7 +42,13 @@ input, button, select, textarea { - #font > .sans-serif(@baseFontSize,normal,@baseLineHeight); + #font > .shorthand(@baseFontSize,normal,@baseLineHeight); // Set size, weight, line-height here +} +input, +button, +select, +textarea { + #font > #family > .sans-serif(); // And only set font-family here for those that need it (note the missing label element) } // Identify controls by their labels -- cgit v1.2.3 From 091622644a0c619e1afbb21041c141da30df76b7 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Thu, 16 Feb 2012 22:34:30 -0800 Subject: bring back checkbox borders to iOS by conditionalizing the border: 0; on it to IE7-9; fix word break on pre in IE --- less/forms.less | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'less/forms.less') diff --git a/less/forms.less b/less/forms.less index be9dbfaa9..0a5fa2b86 100644 --- a/less/forms.less +++ b/less/forms.less @@ -96,9 +96,12 @@ input[type="radio"] { margin: 3px 0; *margin-top: 0; /* IE7 */ line-height: normal; - border: 0; cursor: pointer; .border-radius(0); + border: 0 \9; /* IE9 and down */ +} +input[type="image"] { + border: 0; } // Reset the file input to browser defaults -- cgit v1.2.3