From f15f259876d77004fadf5b5937af5ab6b5eabb8e Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Tue, 13 Aug 2013 09:59:38 -0700 Subject: derp --- less/button-groups.less | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) (limited to 'less/button-groups.less') diff --git a/less/button-groups.less b/less/button-groups.less index 28cb90fc1..0ca9ca851 100644 --- a/less/button-groups.less +++ b/less/button-groups.less @@ -55,11 +55,13 @@ } // Prevent double borders when buttons are next to each other -.btn-group .btn + .btn, -.btn-group .btn + .btn-group, -.btn-group .btn-group + .btn, -.btn-group .btn-group + .btn-group { - margin-left: -1px; +.btn-group { + .btn + .btn, + .btn + .btn-group, + .btn-group + .btn, + .btn-group + .btn-group { + margin-left: -1px; + } } // Optional: Group multiple button groups together for a toolbar @@ -166,26 +168,51 @@ // Vertical button groups // ---------------------- -.btn-group-vertical > .btn { +.btn-group-vertical > .btn, +.btn-group-vertical > .btn-group { display: block; float: none; width: 100%; max-width: 100%; - + .btn { +} +.btn-group-vertical { + .btn + .btn, + .btn + .btn-group, + .btn-group + .btn, + .btn-group + .btn-group { margin-top: -1px; + margin-left: 0; } } -.btn-group-vertical .btn { + +.btn-group-vertical > .btn { &:not(:first-child):not(:last-child) { border-radius: 0; } &:first-child:not(:last-child) { + border-top-right-radius: @border-radius-base; .border-bottom-radius(0); } &:last-child:not(:first-child) { + border-bottom-left-radius: @border-radius-base; .border-top-radius(0); } } +.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group-vertical > .btn-group:first-child { + > .btn:last-child, + > .dropdown-toggle { + border-top-right-radius: @border-radius-base; + .border-bottom-radius(0); + } +} +.btn-group-vertical > .btn-group:last-child > .btn:first-child { + border-bottom-left-radius: @border-radius-base; + .border-top-radius(0); +} + // Justified button groups -- cgit v1.2.3 From 69a3e9b4d07cdaa281525c067f11ea83e1863f1b Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Tue, 13 Aug 2013 10:24:18 -0700 Subject: enable button groups in vertical button groups --- less/button-groups.less | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'less/button-groups.less') diff --git a/less/button-groups.less b/less/button-groups.less index 0ca9ca851..adaad3f80 100644 --- a/less/button-groups.less +++ b/less/button-groups.less @@ -168,18 +168,27 @@ // Vertical button groups // ---------------------- -.btn-group-vertical > .btn, -.btn-group-vertical > .btn-group { - display: block; - float: none; - width: 100%; - max-width: 100%; -} .btn-group-vertical { - .btn + .btn, - .btn + .btn-group, - .btn-group + .btn, - .btn-group + .btn-group { + > .btn, + > .btn-group { + display: block; + float: none; + width: 100%; + max-width: 100%; + } + + // Clear floats so dropdown menus can be properly placed + > .btn-group { + .clearfix(); + > .btn { + float: none; + } + } + + > .btn + .btn, + > .btn + .btn-group, + > .btn-group + .btn, + > .btn-group + .btn-group { margin-top: -1px; margin-left: 0; } @@ -204,12 +213,10 @@ .btn-group-vertical > .btn-group:first-child { > .btn:last-child, > .dropdown-toggle { - border-top-right-radius: @border-radius-base; .border-bottom-radius(0); } } .btn-group-vertical > .btn-group:last-child > .btn:first-child { - border-bottom-left-radius: @border-radius-base; .border-top-radius(0); } -- cgit v1.2.3