From 7d41a387693c49347e06572ceb7ec2207ee30d46 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Fri, 3 May 2013 16:16:26 -0700 Subject: [PATCH] Fixes #7511: add support for nested button groups so you can use dropdowns in your button groups --- docs/assets/css/bootstrap.css | 19 +++++++++++++++++++ docs/docs.html | 22 ++++++++++++++++++++++ less/button-groups.less | 15 +++++++++++++++ 3 files changed, 56 insertions(+) diff --git a/docs/assets/css/bootstrap.css b/docs/assets/css/bootstrap.css index 131b0c6fa1..e1260c7d59 100644 --- a/docs/assets/css/bootstrap.css +++ b/docs/assets/css/bootstrap.css @@ -3889,6 +3889,25 @@ button.close { border-bottom-right-radius: 6px; } +.btn-group > .btn-group { + float: left; +} + +.btn-group > .btn-group > .btn { + border-radius: 0; +} + +.btn-group > .btn-group:last-child > .btn { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; +} + +.btn-group > .btn-group:first-child > .btn { + margin-left: 0; + border-bottom-left-radius: 4px; + border-top-left-radius: 4px; +} + .btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle { outline: 0; diff --git a/docs/docs.html b/docs/docs.html index cd90b15103..3467252154 100644 --- a/docs/docs.html +++ b/docs/docs.html @@ -2919,6 +2919,28 @@ For example, <section> should be wrapped as inline. {% endhighlight %} +

Nested button groups

+

Place buttons groups within button groups when you want dropdown menus mixed with a series of buttons.

+
+
+ + + + +
+ + +
+
+
+

Vertical button groups

Make a set of buttons appear vertically stacked rather than horizontally.

diff --git a/less/button-groups.less b/less/button-groups.less index 884b0b272a..3a72d90bfc 100644 --- a/less/button-groups.less +++ b/less/button-groups.less @@ -73,6 +73,21 @@ .border-right-radius(@border-radius-large); } +// 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 { + border-radius: 0; +} +.btn-group > .btn-group:last-child > .btn { + .border-right-radius(@border-radius-base); +} +.btn-group > .btn-group:first-child > .btn { + margin-left: 0; + .border-left-radius(@border-radius-base); +} + // On active and open, don't show outline .btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle {