diff options
| author | Mark Otto <[email protected]> | 2013-02-28 21:19:02 -0800 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2013-02-28 21:19:02 -0800 |
| commit | bfc4aaf6e84f20728258672276ccc9db84638082 (patch) | |
| tree | 75aa91d0929b24257ca67ac3b3b7ae611faa2b19 /less | |
| parent | b19eb88b5abb7fd9dfc3aacc7ac3d296e1e98861 (diff) | |
| download | bootstrap-bfc4aaf6e84f20728258672276ccc9db84638082.tar.xz bootstrap-bfc4aaf6e84f20728258672276ccc9db84638082.zip | |
Holy fucking shit fix that input group with buttons rounded corner noise
Diffstat (limited to 'less')
| -rw-r--r-- | less/button-groups.less | 13 | ||||
| -rw-r--r-- | less/buttons.less | 1 | ||||
| -rw-r--r-- | less/forms.less | 64 |
3 files changed, 40 insertions, 38 deletions
diff --git a/less/button-groups.less b/less/button-groups.less index a816a1ae1..ddb549e4b 100644 --- a/less/button-groups.less +++ b/less/button-groups.less @@ -16,7 +16,17 @@ display: inline-block; vertical-align: middle; // match .btn alignment given font-size hack above > .btn { + position: relative; float: left; + // Prevent double borders when buttons are next to each other + + btn { + margin-left: -1px; + } + // Bring the "active" button to the front + &:hover, + &:active { + z-index: 2; + } } } @@ -116,13 +126,14 @@ .btn-group-vertical > .btn { display: block; float: none; - border-radius: 0; max-width: 100%; } .btn-group-vertical .btn:first-child { + border-radius: 0; // Needs to be here for specificity since we're not zeroing them out again .border-top-radius(@border-radius-base); } .btn-group-vertical .btn:last-child { + border-radius: 0; // Needs to be here for specificity since we're not zeroing them out again .border-bottom-radius(@border-radius-base); } .btn-group-vertical .btn-large:first-child { diff --git a/less/buttons.less b/less/buttons.less index 6996ea050..7eaaeb13f 100644 --- a/less/buttons.less +++ b/less/buttons.less @@ -19,6 +19,7 @@ cursor: pointer; border: 1px solid @btn-border; border-radius: @border-radius-base; + white-space: nowrap; &:focus { .tab-focus(); diff --git a/less/forms.less b/less/forms.less index c04b7ec89..1aba99ce0 100644 --- a/less/forms.less +++ b/less/forms.less @@ -503,52 +503,43 @@ select:focus:invalid { // Button input groups // ------------------------- -.input-group-btn, -.input-group-btn .btn { +.input-group-btn { + position: relative; white-space: nowrap; } .input-group-btn > .btn { + position: relative; float: left; // Collapse white-space border-radius: 0; + .btn { - border-left: 0; - } -} -.input-group-btn.btn-group { - display: table-cell; -} -// Prepend -.input-group-btn { - &:first-child > .btn, - &.btn-group:first-child > .btn { - border-right: 0; + margin-left: -1px; } - &:first-child > .btn, - &.btn-group:first-child > .btn { - border-radius: @border-radius-base 0 0 @border-radius-base; - &.btn-large { - border-radius:@border-radius-large 0 0 @border-radius-large; - } - &.btn-small { - border-radius:@border-radius-small 0 0 @border-radius-small; - } + // Bring the "active" button to the front + &:hover, + &:active { + z-index: 2; } } -// Append -.input-group-btn { - &:last-child > .btn, - &.btn-group:last-child > .btn:first-child { - border-left: 0; + +// Prepended buttons +.input-group-btn:first-child { + // Round the left corners only + > .btn:first-child, + > .dropdown-toggle:first-child { + .border-left-radius(@border-radius-base); + &.btn-large { .border-left-radius(@border-radius-large); } + &.btn-small { .border-left-radius(@border-radius-small); } } - &:last-child > .btn, - &.btn-group:last-child > .btn { - border-radius: 0 @border-radius-base @border-radius-base 0; - &.btn-large { - border-radius: 0 @border-radius-large @border-radius-large 0; - } - &.btn-small { - border-radius: 0 @border-radius-small @border-radius-small 0; - } +} + +// Appended buttons +.input-group-btn:last-child { + // Round the right corners only + > .btn:last-child, + > .dropdown-toggle { + .border-right-radius(@border-radius-base); + &.btn-large { .border-right-radius(@border-radius-large); } + &.btn-small { .border-right-radius(@border-radius-small); } } } @@ -557,7 +548,6 @@ select:focus:invalid { // Horizontal forms // -------------------------------------------------- - @media screen and (min-width: 768px) { .form-horizontal { |
