aboutsummaryrefslogtreecommitdiff
path: root/lib/forms.less
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2011-09-11 18:44:25 -0700
committerMark Otto <[email protected]>2011-09-11 18:44:25 -0700
commit53812bc2d82adb1a4a96afb33391a1d59990c4fe (patch)
tree463fe7231116e9b5ec83f144e8ac433ca0fd9e51 /lib/forms.less
parentf3f60b21a6104be999cb04f6414878fc4dea98cd (diff)
downloadbootstrap-53812bc2d82adb1a4a96afb33391a1d59990c4fe.tar.xz
bootstrap-53812bc2d82adb1a4a96afb33391a1d59990c4fe.zip
remove qualifying tags in .span selectors for built in grid so that we can use .span-n classes in form styles
Diffstat (limited to 'lib/forms.less')
-rw-r--r--lib/forms.less29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/forms.less b/lib/forms.less
index 90b8720f0..c86751193 100644
--- a/lib/forms.less
+++ b/lib/forms.less
@@ -184,6 +184,7 @@ form div.error {
}
// Form element sizes
+// TODO v2: remove duplication here and just stick to .input-[size] in light of adding .spanN sizes
.input-mini,
input.mini,
textarea.mini,
@@ -224,6 +225,34 @@ textarea.xxlarge {
overflow-y: auto;
}
+// Grid style input sizes
+// This is a duplication of the main grid .columns() mixin, but subtracts 10px to account for input padding and border
+.formColumns(@columnSpan: 1) {
+ width: ((@gridColumnWidth - 10) * @columnSpan) + ((@gridColumnWidth - 10) * (@columnSpan - 1));
+ margin-left: 0;
+}
+input,
+textarea,
+select {
+ // Default columns
+ &.span1 { .formColumns(1); }
+ &.span2 { .formColumns(2); }
+ &.span3 { .formColumns(3); }
+ &.span4 { .formColumns(4); }
+ &.span5 { .formColumns(5); }
+ &.span6 { .formColumns(6); }
+ &.span7 { .formColumns(7); }
+ &.span8 { .formColumns(8); }
+ &.span9 { .formColumns(9); }
+ &.span10 { .formColumns(10); }
+ &.span11 { .formColumns(11); }
+ &.span12 { .formColumns(12); }
+ &.span13 { .formColumns(13); }
+ &.span14 { .formColumns(14); }
+ &.span15 { .formColumns(15); }
+ &.span16 { .formColumns(16); }
+}
+
// Disabled and read-only inputs
input[disabled],
select[disabled],