Skip to content

Commit ee5d2ec

Browse files
committed
add block level input mixin for border-box box-sizing
1 parent c8f4325 commit ee5d2ec

File tree

5 files changed

+39
-17
lines changed

5 files changed

+39
-17
lines changed

docs/assets/bootstrap.zip

149 Bytes
Binary file not shown.

docs/assets/css/bootstrap-responsive.css

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@
2323
text-indent: 100%;
2424
white-space: nowrap;
2525
}
26+
.input-block-level {
27+
display: block;
28+
width: 100%;
29+
min-height: 28px;
30+
/* Make inputs at least the height of their button counterpart */
31+
32+
/* Makes inputs behave like true block-level elements */
33+
34+
-webkit-box-sizing: border-box;
35+
-moz-box-sizing: border-box;
36+
-ms-box-sizing: border-box;
37+
box-sizing: border-box;
38+
}
2639
.hidden {
2740
display: none;
2841
visibility: hidden;
@@ -160,17 +173,9 @@
160173
/* Makes inputs behave like true block-level elements */
161174

162175
-webkit-box-sizing: border-box;
163-
/* Older Webkit */
164-
165176
-moz-box-sizing: border-box;
166-
/* Older FF */
167-
168177
-ms-box-sizing: border-box;
169-
/* IE8 */
170-
171178
box-sizing: border-box;
172-
/* CSS3 spec*/
173-
174179
}
175180
.input-prepend input[class*="span"],
176181
.input-append input[class*="span"] {

docs/assets/css/bootstrap.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,19 @@ textarea {
117117
text-indent: 100%;
118118
white-space: nowrap;
119119
}
120+
.input-block-level {
121+
display: block;
122+
width: 100%;
123+
min-height: 28px;
124+
/* Make inputs at least the height of their button counterpart */
125+
126+
/* Makes inputs behave like true block-level elements */
127+
128+
-webkit-box-sizing: border-box;
129+
-moz-box-sizing: border-box;
130+
-ms-box-sizing: border-box;
131+
box-sizing: border-box;
132+
}
120133
body {
121134
margin: 0;
122135
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;

less/mixins.less

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
white-space: nowrap;
108108
}
109109

110+
110111
// FONTS
111112
// --------------------------------------------------
112113

@@ -142,9 +143,19 @@
142143
}
143144

144145

145-
// Form field states (used in forms.less)
146+
// FORMS
146147
// --------------------------------------------------
147148

149+
// Block level inputs
150+
.input-block-level {
151+
display: block;
152+
width: 100%;
153+
min-height: 28px; /* Make inputs at least the height of their button counterpart */
154+
/* Makes inputs behave like true block-level elements */
155+
.box-sizing(border-box);
156+
}
157+
158+
148159
// Mixin for form field states
149160
.formFieldState(@textColor: #555, @borderColor: #ccc, @backgroundColor: #f5f5f5) {
150161
// Set the text color

less/responsive.less

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,7 @@
182182
select[class*="span"],
183183
textarea[class*="span"],
184184
.uneditable-input {
185-
display: block;
186-
width: 100%;
187-
min-height: 28px; /* Make inputs at least the height of their button counterpart */
188-
/* Makes inputs behave like true block-level elements */
189-
-webkit-box-sizing: border-box; /* Older Webkit */
190-
-moz-box-sizing: border-box; /* Older FF */
191-
-ms-box-sizing: border-box; /* IE8 */
192-
box-sizing: border-box; /* CSS3 spec*/
185+
.input-block-level();
193186
}
194187
// But don't let it screw up prepend/append inputs
195188
.input-prepend input[class*="span"],

0 commit comments

Comments
 (0)