aboutsummaryrefslogtreecommitdiff
path: root/less/button-groups.less
diff options
context:
space:
mode:
authorIvan Khalopik <[email protected]>2013-05-27 11:06:31 +0300
committerIvan Khalopik <[email protected]>2013-05-27 11:06:31 +0300
commit3285f4c3062f4a56eaed2461a3128a2e6a3ba9cc (patch)
tree5fa0a3d3556a83cd96147da46e90ae9f361d8efc /less/button-groups.less
parent3c7a43a1f373d0c534476578b96a75ae2e63c985 (diff)
parent7cbb1c0452a1d9904f7655aea78644def85b7f2e (diff)
downloadbootstrap-3285f4c3062f4a56eaed2461a3128a2e6a3ba9cc.tar.xz
bootstrap-3285f4c3062f4a56eaed2461a3128a2e6a3ba9cc.zip
Merge remote-tracking branch 'bootstrap/3.0.0-wip' into 3.0.0-wip
Conflicts: js/bootstrap-collapse.js
Diffstat (limited to 'less/button-groups.less')
-rw-r--r--less/button-groups.less71
1 files changed, 30 insertions, 41 deletions
diff --git a/less/button-groups.less b/less/button-groups.less
index 3a72d90bf..f7934a328 100644
--- a/less/button-groups.less
+++ b/less/button-groups.less
@@ -4,24 +4,21 @@
// Button carets
.btn .caret {
- border-top-color: @btn-color;
+ border-top-color: @btn-default-color;
}
.dropup .btn .caret {
- border-bottom-color: @btn-color;
+ border-bottom-color: @btn-default-color;
}
// Make the div behave like a button
-.btn-group {
+.btn-group,
+.btn-group-vertical {
position: relative;
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 {
@@ -30,6 +27,11 @@
}
}
+// Prevent double borders when buttons are next to each other
+.btn-group .btn + .btn {
+ margin-left: -1px;
+}
+
// Optional: Group multiple button groups together for a toolbar
.btn-toolbar {
.clearfix();
@@ -46,46 +48,36 @@
}
}
-// Float them, remove border radius, then re-add to first and last elements
-.btn-group > .btn {
- position: relative;
+.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
border-radius: 0;
}
-
// Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match
.btn-group > .btn:first-child {
margin-left: 0;
- .border-left-radius(@border-radius-base);
+ &:not(:last-child):not(.dropdown-toggle) {
+ .border-right-radius(0);
+ }
}
// Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it
-.btn-group > .btn:last-child,
-.btn-group > .dropdown-toggle {
- .border-right-radius(@border-radius-base);
-}
-// Reset corners for large buttons
-.btn-group > .btn.large:first-child {
- margin-left: 0;
- .border-left-radius(@border-radius-large);
-}
-.btn-group > .btn.large:last-child,
-.btn-group > .large.dropdown-toggle {
- .border-right-radius(@border-radius-large);
+.btn-group > .btn:last-child:not(:first-child),
+.btn-group > .dropdown-toggle:not(:first-child) {
+ .border-left-radius(0);
}
// Custom edits for including btn-groups within btn-groups (useful for including dropdown buttons within a btn-group)
.btn-group > .btn-group {
float: left;
}
-.btn-group > .btn-group > .btn {
+.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
-.btn-group > .btn-group:last-child > .btn {
- .border-right-radius(@border-radius-base);
+.btn-group > .btn-group:first-child > .btn:last-child,
+.btn-group > .btn-group:first-child > .dropdown-toggle {
+ .border-right-radius(0);
}
-.btn-group > .btn-group:first-child > .btn {
- margin-left: 0;
- .border-left-radius(@border-radius-base);
+.btn-group > .btn-group:last-child > .btn:first-child {
+ .border-left-radius(0);
}
// On active and open, don't show outline
@@ -122,7 +114,6 @@
// Reposition the caret
.btn .caret {
- margin-top: 8px;
margin-left: 0;
}
// Carets in other button sizes
@@ -143,20 +134,18 @@
float: none;
width: 100%;
max-width: 100%;
+ + .btn {
+ margin-top: -1px;
+ }
+}
+.btn-group-vertical .btn:not(:first-child):not(:last-child) {
+ border-radius: 0;
}
.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);
+ .border-bottom-radius(0);
}
.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 {
- .border-top-radius(@border-radius-large);
-}
-.btn-group-vertical .btn-large:last-child {
- .border-bottom-radius(@border-radius-large);
+ .border-top-radius(0);
}