Skip to content

Commit 91eef35

Browse files
committed
remove need for floats and IE hacks for input-prepend and input-append--boom
1 parent 0630cd6 commit 91eef35

File tree

5 files changed

+8
-52
lines changed

5 files changed

+8
-52
lines changed

docs/assets/bootstrap.zip

-115 Bytes
Binary file not shown.

docs/assets/css/bootstrap.css

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -983,18 +983,6 @@ select:focus:required:invalid:focus {
983983
.input-prepend,
984984
.input-append {
985985
margin-bottom: 5px;
986-
*zoom: 1;
987-
}
988-
.input-prepend:before,
989-
.input-append:before,
990-
.input-prepend:after,
991-
.input-append:after {
992-
display: table;
993-
content: "";
994-
}
995-
.input-prepend:after,
996-
.input-append:after {
997-
clear: both;
998986
}
999987
.input-prepend input,
1000988
.input-append input,
@@ -1021,8 +1009,7 @@ select:focus:required:invalid:focus {
10211009
}
10221010
.input-prepend .add-on,
10231011
.input-append .add-on {
1024-
float: left;
1025-
display: block;
1012+
display: inline-block;
10261013
width: auto;
10271014
min-width: 16px;
10281015
height: 18px;
@@ -1032,6 +1019,7 @@ select:focus:required:invalid:focus {
10321019
line-height: 18px;
10331020
text-align: center;
10341021
text-shadow: 0 1px 0 #ffffff;
1022+
vertical-align: middle;
10351023
background-color: #eeeeee;
10361024
border: 1px solid #ccc;
10371025
-webkit-border-radius: 3px 0 0 3px;
@@ -1043,14 +1031,8 @@ select:focus:required:invalid:focus {
10431031
background-color: #a9dba9;
10441032
border-color: #46a546;
10451033
}
1046-
.input-prepend .add-on {
1047-
*margin-top: 1px;
1048-
/* IE6-7 */
1049-
1050-
}
10511034
.input-append input,
10521035
.input-append select .uneditable-input {
1053-
float: left;
10541036
-webkit-border-radius: 3px 0 0 3px;
10551037
-moz-border-radius: 3px 0 0 3px;
10561038
border-radius: 3px 0 0 3px;
@@ -1066,12 +1048,6 @@ select:focus:required:invalid:focus {
10661048
-moz-border-radius: 0 3px 3px 0;
10671049
border-radius: 0 3px 3px 0;
10681050
}
1069-
.input-append input:first-child {
1070-
*margin-left: -160px;
1071-
}
1072-
.input-append input:first-child + .add-on {
1073-
*margin-left: -21px;
1074-
}
10751051
.search-query {
10761052
padding-left: 14px;
10771053
padding-right: 14px;

docs/base-css.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,8 +1187,7 @@ <h3>Form validation</h3>
11871187
<label class="control-label" for="prependedInput">Prepended text</label>
11881188
<div class="controls">
11891189
<div class="input-prepend">
1190-
<span class="add-on">@</span>
1191-
<input class="span2" id="prependedInput" size="16" type="text">
1190+
<span class="add-on">@</span><input class="span2" id="prependedInput" size="16" type="text">
11921191
</div>
11931192
<p class="help-block">Here's some help text</p>
11941193
</div>
@@ -1197,8 +1196,7 @@ <h3>Form validation</h3>
11971196
<label class="control-label" for="appendedInput">Appended text</label>
11981197
<div class="controls">
11991198
<div class="input-append">
1200-
<input class="span2" id="appendedInput" size="16" type="text">
1201-
<span class="add-on">.00</span>
1199+
<input class="span2" id="appendedInput" size="16" type="text"><span class="add-on">.00</span>
12021200
</div>
12031201
<p class="help-block">Here's more help text</p>
12041202
</div>

docs/templates/pages/base-css.mustache

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,8 +1111,7 @@
11111111
<label class="control-label" for="prependedInput">{{_i}}Prepended text{{/i}}</label>
11121112
<div class="controls">
11131113
<div class="input-prepend">
1114-
<span class="add-on">@</span>
1115-
<input class="span2" id="prependedInput" size="16" type="text">
1114+
<span class="add-on">@</span><input class="span2" id="prependedInput" size="16" type="text">
11161115
</div>
11171116
<p class="help-block">{{_i}}Here's some help text{{/i}}</p>
11181117
</div>
@@ -1121,8 +1120,7 @@
11211120
<label class="control-label" for="appendedInput">{{_i}}Appended text{{/i}}</label>
11221121
<div class="controls">
11231122
<div class="input-append">
1124-
<input class="span2" id="appendedInput" size="16" type="text">
1125-
<span class="add-on">.00</span>
1123+
<input class="span2" id="appendedInput" size="16" type="text"><span class="add-on">.00</span>
11261124
</div>
11271125
<p class="help-block">{{_i}}Here's more help text{{/i}}</p>
11281126
</div>

less/forms.less

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,6 @@ select:focus:required:invalid {
362362
.input-prepend,
363363
.input-append {
364364
margin-bottom: 5px;
365-
.clearfix(); // Clear the float to prevent wrapping
366365
input,
367366
select,
368367
.uneditable-input {
@@ -376,8 +375,7 @@ select:focus:required:invalid {
376375
border-left-color: #ccc;
377376
}
378377
.add-on {
379-
float: left;
380-
display: block;
378+
display: inline-block;
381379
width: auto;
382380
min-width: 16px;
383381
height: @baseLineHeight;
@@ -387,6 +385,7 @@ select:focus:required:invalid {
387385
line-height: @baseLineHeight;
388386
text-align: center;
389387
text-shadow: 0 1px 0 @white;
388+
vertical-align: middle;
390389
background-color: @grayLighter;
391390
border: 1px solid #ccc;
392391
.border-radius(3px 0 0 3px);
@@ -396,16 +395,10 @@ select:focus:required:invalid {
396395
border-color: @green;
397396
}
398397
}
399-
.input-prepend {
400-
.add-on {
401-
*margin-top: 1px; /* IE6-7 */
402-
}
403-
}
404398
.input-append {
405399
input,
406400
select
407401
.uneditable-input {
408-
float: left;
409402
.border-radius(3px 0 0 3px);
410403
}
411404
.uneditable-input {
@@ -417,15 +410,6 @@ select:focus:required:invalid {
417410
margin-left: -1px;
418411
.border-radius(0 3px 3px 0);
419412
}
420-
input:first-child {
421-
// In IE7, having a hasLayout container (from clearfix's zoom:1) can make the first input
422-
// inherit the sum of its ancestors' margins.
423-
*margin-left: -160px;
424-
425-
&+.add-on {
426-
*margin-left: -21px;
427-
}
428-
}
429413
}
430414

431415

0 commit comments

Comments
 (0)