Skip to content

Commit

Permalink
Fix handling of btn-group placed inside input-group-btn (used for mix…
Browse files Browse the repository at this point in the history
…ing dropdowns with normal buttons)
  • Loading branch information
SPodjasek committed Dec 16, 2013
1 parent 94635eb commit ae640d4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
14 changes: 10 additions & 4 deletions dist/css/bootstrap.css
Original file line number Diff line number Diff line change
Expand Up @@ -3361,8 +3361,10 @@ textarea.input-group-sm > .input-group-btn > .btn {
.input-group .form-control:first-child,
.input-group-addon:first-child,
.input-group-btn:first-child > .btn,
.input-group-btn:first-child > .btn-group > .btn,
.input-group-btn:first-child > .dropdown-toggle,
.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),
.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
Expand All @@ -3372,8 +3374,10 @@ textarea.input-group-sm > .input-group-btn > .btn {
.input-group .form-control:last-child,
.input-group-addon:last-child,
.input-group-btn:last-child > .btn,
.input-group-btn:last-child > .btn-group > .btn,
.input-group-btn:last-child > .dropdown-toggle,
.input-group-btn:first-child > .btn:not(:first-child) {
.input-group-btn:first-child > .btn:not(:first-child),
.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
Expand All @@ -3396,10 +3400,12 @@ textarea.input-group-sm > .input-group-btn > .btn {
.input-group-btn > .btn:active {
z-index: 2;
}
.input-group-btn:first-child > .btn {
.input-group-btn:first-child > .btn,
.input-group-btn:first-child > .btn-group {
margin-right: -1px;
}
.input-group-btn:last-child > .btn {
.input-group-btn:last-child > .btn,
.input-group-btn:last-child > .btn-group {
margin-left: -1px;
}
.nav {
Expand Down
2 changes: 1 addition & 1 deletion dist/css/bootstrap.min.css

Large diffs are not rendered by default.

22 changes: 16 additions & 6 deletions less/input-groups.less
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@
.input-group .form-control:first-child,
.input-group-addon:first-child,
.input-group-btn:first-child > .btn,
.input-group-btn:first-child > .btn-group > .btn,
.input-group-btn:first-child > .dropdown-toggle,
.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),
.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {
.border-right-radius(0);
}
.input-group-addon:first-child {
Expand All @@ -105,8 +107,10 @@
.input-group .form-control:last-child,
.input-group-addon:last-child,
.input-group-btn:last-child > .btn,
.input-group-btn:last-child > .btn-group > .btn,
.input-group-btn:last-child > .dropdown-toggle,
.input-group-btn:first-child > .btn:not(:first-child) {
.input-group-btn:first-child > .btn:not(:first-child),
.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {
.border-left-radius(0);
}
.input-group-addon:last-child {
Expand Down Expand Up @@ -138,10 +142,16 @@
}

// Negative margin to only have a 1px border between the two
&:first-child > .btn {
margin-right: -1px;
&:first-child {
> .btn,
> .btn-group {
margin-right: -1px;
}
}
&:last-child > .btn {
margin-left: -1px;
&:last-child {
> .btn,
> .btn-group {
margin-left: -1px;
}
}
}

0 comments on commit ae640d4

Please sign in to comment.