diff options
| author | Mark Otto <[email protected]> | 2013-08-13 10:35:04 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2013-08-13 10:35:04 -0700 |
| commit | ce77f10ce5f53be5a6baf11f50a99b0bca48e99a (patch) | |
| tree | ef46ab99f830b8fe5ddce1fbe7ac35d5b8bdec7b | |
| parent | d4b14cbf442140d1462200e5f5c8ea2faeac5332 (diff) | |
| parent | 6ec0fd7d43d1ab243a8796b7544a4634ef086117 (diff) | |
| download | bootstrap-ce77f10ce5f53be5a6baf11f50a99b0bca48e99a.tar.xz bootstrap-ce77f10ce5f53be5a6baf11f50a99b0bca48e99a.zip | |
Merge pull request #9421 from ggam/input-size
Added input-size mixin
| -rw-r--r-- | less/forms.less | 36 | ||||
| -rw-r--r-- | less/mixins.less | 23 |
2 files changed, 26 insertions, 33 deletions
diff --git a/less/forms.less b/less/forms.less index af575db22..18d3efb54 100644 --- a/less/forms.less +++ b/less/forms.less @@ -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); } diff --git a/less/mixins.less b/less/mixins.less index 24bce6bbf..9d8ca0382 100644 --- a/less/mixins.less +++ b/less/mixins.less @@ -636,3 +636,26 @@ .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; + } +} |
