]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
prevent button group buttons from wrapping in tight spaces by removing floats and...
authorMark Otto <markotto@twitter.com>
Mon, 25 Jun 2012 22:46:46 +0000 (15:46 -0700)
committerMark Otto <markotto@twitter.com>
Mon, 25 Jun 2012 22:47:07 +0000 (15:47 -0700)
docs/assets/css/bootstrap.css
less/button-groups.less
less/tests/css-tests.html

index ffda9502f3076693ac276e9bba6efc038cf4a5f6..922c46b208d91a0447139781d8e07314cc450aea 100644 (file)
@@ -3104,17 +3104,8 @@ input[type="submit"].btn.btn-mini {
 .btn-group {
   position: relative;
   *margin-left: .3em;
-  *zoom: 1;
-}
-
-.btn-group:before,
-.btn-group:after {
-  display: table;
-  content: "";
-}
-
-.btn-group:after {
-  clear: both;
+  font-size: 0;
+  white-space: nowrap;
 }
 
 .btn-group:first-child {
@@ -3140,13 +3131,22 @@ input[type="submit"].btn.btn-mini {
 
 .btn-group > .btn {
   position: relative;
-  float: left;
   margin-left: -1px;
+  font-size: 13px;
   -webkit-border-radius: 0;
      -moz-border-radius: 0;
           border-radius: 0;
 }
 
+.btn-group > .btn-mini,
+.btn-group > .btn-small {
+  font-size: 11px;
+}
+
+.btn-group > .btn-large {
+  font-size: 15px;
+}
+
 .btn-group > .btn:first-child {
   margin-left: 0;
   -webkit-border-bottom-left-radius: 4px;
index e3c1de8adf885eca4f4276d34049215c95711118..44f13a09a27bee3b3add3c59767ef85d186ae198 100644 (file)
@@ -5,7 +5,8 @@
 // Make the div behave like a button
 .btn-group {
   position: relative;
-  .clearfix(); // clears the floated buttons
+  font-size: 0; // remove as part 1 of font-size inline-block hack
+  white-space: nowrap; // prevent buttons from wrapping when in tight spaces (e.g., the table on the tests page)
   .ie7-restore-left-whitespace();
 }
 
 // Float them, remove border radius, then re-add to first and last elements
 .btn-group > .btn {
   position: relative;
-  float: left;
   margin-left: -1px;
+  font-size: @baseFontSize; // redeclare as part 2 of font-size inline-block hack
   .border-radius(0);
 }
+
+// Reset fonts for other sizes
+.btn-group > .btn-mini,
+.btn-group > .btn-small {
+  font-size: @baseFontSize - 2px;
+}
+.btn-group > .btn-large {
+  font-size: @baseFontSize + 2px;
+}
+
 // 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;
index a61f6923a77a67ccd2cb4a5a23ce52aca5ac2606..2396e348cf211c7c2138c0a3e02d67a6ade07d4f 100644 (file)
 
 
 
+<!-- Button groups
+================================================== -->
+
+<div class="page-header">
+  <h1>Button groups</h1>
+</div>
+
+<table class="table table-bordered">
+  <tbody>
+    <tr>
+      <td>
+        Maecenas faucibus mollis interdum. Nulla vitae elit libero, a pharetra augue. Donec ullamcorper nulla non metus auctor fringilla. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
+      </td>
+      <td>
+        <div class="btn-group">
+          <button class="btn">1</button>
+          <button class="btn">2</button>
+          <button class="btn">3</button>
+          <button class="btn">4</button>
+        </div>
+      </td>
+    </tr>
+  </tbody>
+</table>
+
+
+
+