From 72da5dd54d154bb2b87b0ec23107eca775c72f51 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Thu, 1 Sep 2011 22:53:24 -0700 Subject: for html5 style all inputs -- then unstyle checkbox, radio, button, reset, submit --- lib/forms.less | 46 +++++++++++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 13 deletions(-) (limited to 'lib/forms.less') diff --git a/lib/forms.less b/lib/forms.less index 88ae08d8a..d79decd24 100644 --- a/lib/forms.less +++ b/lib/forms.less @@ -61,8 +61,7 @@ input[type=radio] { } // Inputs, Textareas, Selects -input[type=text], -input[type=password], +input, textarea, select, .uneditable-input { @@ -76,14 +75,40 @@ select, border: 1px solid #ccc; .border-radius(3px); } + +/* mini reset for non-html5 file types */ +input[type=checkbox], +input[type=radio] { + width: auto; + padding: 0; + line-height: normal; + height: auto; + margin: 3px 0; +} + +input[type=file] { + border: 0; + padding: 0; + .box-shadow(none); +} + +input[type=button], +input[type=reset], +input[type=submit] { + width: auto; + height: auto; +} + select, input[type=file] { height: @baseline * 1.5; line-height: @baseline * 1.5; } + textarea { height: auto; } + .uneditable-input { background-color: #eee; display: block; @@ -100,15 +125,13 @@ textarea { } // Focus states -input[type=text], -input[type=password], +input, select, textarea { @transition: border linear .2s, box-shadow linear .2s; .transition(@transition); .box-shadow(inset 0 1px 3px rgba(0,0,0,.1)); } -input[type=text]:focus, -input[type=password]:focus, +input:focus, textarea:focus { outline: none; border-color: rgba(82,168,236,.8); @@ -128,8 +151,7 @@ form div.error { span.help-block { color: @red; } - input[type=text], - input[type=password], + input, textarea { border-color: @error-text; .box-shadow(0 0 3px rgba(171,41,32,.25)); @@ -221,7 +243,7 @@ input.disabled { // Inline Fields (input fields that appear as inline objects .inline-inputs { color: @gray; - span, input[type=text] { + span, input { display: inline-block; } input.mini { @@ -238,8 +260,7 @@ input.disabled { // Allow us to put symbols and text within the input field for a cleaner look .input-prepend, .input-append { - input[type=text], - input[type=password] { + input { .border-radius(0 3px 3px 0); } .add-on { @@ -270,8 +291,7 @@ input.disabled { } } .input-append { - input[type=text], - input[type=password] { + input { float: left; .border-radius(3px 0 0 3px); } -- cgit v1.2.3 From 62f891640714d86e1c26a0d5c9da9ee63ac22f21 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Fri, 2 Sep 2011 11:53:58 -0700 Subject: update the file input to undo the damage of the generic input selector --- lib/forms.less | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib/forms.less') diff --git a/lib/forms.less b/lib/forms.less index d79decd24..3fc62f93d 100644 --- a/lib/forms.less +++ b/lib/forms.less @@ -67,10 +67,10 @@ select, .uneditable-input { display: inline-block; width: 210px; + height: @baseline; padding: 4px; font-size: 13px; line-height: @baseline; - height: @baseline; color: @gray; border: 1px solid #ccc; .border-radius(3px); @@ -80,15 +80,18 @@ select, input[type=checkbox], input[type=radio] { width: auto; - padding: 0; - line-height: normal; height: auto; + padding: 0; margin: 3px 0; + line-height: normal; + border: none; } input[type=file] { - border: 0; - padding: 0; + background-color: #fff; + padding: initial; + border: initial; + line-height: initial; .box-shadow(none); } -- cgit v1.2.3 From 298e1b59bbf389ba8ec45de6428f1128ac71114c Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Fri, 2 Sep 2011 12:46:47 -0700 Subject: fix broken checkbox in ie7 --- lib/forms.less | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/forms.less') diff --git a/lib/forms.less b/lib/forms.less index 3fc62f93d..a16844ab1 100644 --- a/lib/forms.less +++ b/lib/forms.less @@ -83,6 +83,7 @@ input[type=radio] { height: auto; padding: 0; margin: 3px 0; + *margin-top: 0; /* IE6-7 */ line-height: normal; border: none; } -- cgit v1.2.3