]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Added input-size mixin 9421/head
authorggam <ggam@brainleakage.com>
Tue, 13 Aug 2013 17:06:02 +0000 (19:06 +0200)
committerggam <ggam@brainleakage.com>
Tue, 13 Aug 2013 17:06:02 +0000 (19:06 +0200)
less/forms.less
less/mixins.less

index af575db225fbe29689f565a44b1fd65ea4451562..18d3efb547d3a21d5f8f2f578b4cc4871c06e427 100644 (file)
@@ -208,43 +208,13 @@ input[type="number"] {
 }
 
 
-
 // Form control sizing
-//
-// Relative text size, padding, and border-radii changes for form controls. For
-// horizontal sizing, wrap controls in the predefined grid classes. `<select>`
-// element gets special love because it's special, and that's a fact!
-
-.input-lg {
-  height: @input-height-large;
-  padding: @padding-large-vertical @padding-large-horizontal;
-  font-size: @font-size-large;
-  line-height: @line-height-large;
-  border-radius: @border-radius-large;
-}
 .input-sm {
-  height: @input-height-small;
-  padding: @padding-small-vertical @padding-small-horizontal;
-  font-size: @font-size-small;
-  line-height: @line-height-small;
-  border-radius: @border-radius-small;
+  .input-size(@input-height-large; @padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @border-radius-large);
 }
 
-select {
-  &.input-lg {
-    height: @input-height-large;
-    line-height: @input-height-large;
-  }
-  &.input-sm {
-    height: @input-height-small;
-    line-height: @input-height-small;
-  }
-}
-textarea {
-  &.input-lg,
-  &.input-sm {
-    height: auto;
-  }
+.input-lg {
+  .input-size(@input-height-small; @padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small);
 }
 
 
index 24bce6bbffd6931a6d81053b0dade78e221e0938..9d8ca03827b16b0fd73a661b4adbae7322f66bae 100644 (file)
     .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}");
   }
 }
+
+// Form control sizing
+//
+// Relative text size, padding, and border-radii changes for form controls. For
+// horizontal sizing, wrap controls in the predefined grid classes. `<select>`
+// element gets special love because it's special, and that's a fact!
+
+.input-size(@input-height; @padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {
+  height: @input-height;
+  padding: @padding-vertical @padding-horizontal;
+  font-size: @font-size;
+  line-height: @line-height;
+  border-radius: @border-radius;
+  
+  select& {
+    height: @input-height;
+    line-height: @input-height;
+  }
+  
+  textarea& {
+    height: auto;
+  }
+}