]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Tighten up badges docs; less bottom margin on h3
authorMark Otto <otto@github.com>
Sun, 20 Jan 2013 02:53:41 +0000 (18:53 -0800)
committerMark Otto <otto@github.com>
Sun, 20 Jan 2013 02:53:41 +0000 (18:53 -0800)
docs/assets/css/bootstrap.css
docs/components.html
docs/templates/pages/components.mustache
less/counters.less
less/type.less

index a78ab929ac7574aadcfd4e50212bd8e351fad19f..47396530a4be05c158bf8b73446b290fabc39417 100644 (file)
@@ -425,13 +425,13 @@ h6 small {
 }
 
 h1,
-h2,
-h3 {
+h2 {
   margin-top: 20px;
   margin-bottom: 10px;
   line-height: 40px;
 }
 
+h3,
 h4,
 h5,
 h6 {
@@ -4006,15 +4006,14 @@ a.thumbnail:hover {
 .counter {
   display: inline-block;
   min-width: 10px;
-  padding: 2px 7px;
-  font-size: 11.844px;
+  padding: 3px 7px;
+  font-size: 12px;
   font-weight: bold;
-  line-height: 14px;
+  line-height: 1;
   color: #fff;
   text-align: center;
-  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
   white-space: nowrap;
-  vertical-align: baseline;
+  vertical-align: middle;
   background-color: #999999;
   border-radius: 10px;
 }
@@ -4038,6 +4037,16 @@ a.counter:hover {
   top: 0;
 }
 
+.nav-list > .active > a > .counter,
+.nav-pills > .active > a > .counter {
+  color: #428bca;
+  background-color: #fff;
+}
+
+.nav-pills > li > a > .counter {
+  margin-left: 3px;
+}
+
 @-webkit-keyframes progress-bar-stripes {
   from {
     background-position: 40px 0;
index 6710e8338e4f84c9a56e2c9f22badd6c26315f21..b88e54b88cd9619f932714a373713dbf232e2f8a 100644 (file)
             <h1>Counters</h1>
           </div>
 
+          <h3>Basic usage</h3>
+          <p>Counters are used to indicator unread or new items. Add a <code>&lt;span class="counter"&gt;</code> to links, Bootstrap navs, and more.</p>
           <div class="bs-docs-example">
             <a href="#">Inbox</a> <span class="counter">42</span>
           </div>
-
 <pre class="prettyprint linenums">
 &lt;a href="#"&gt;Inbox&lt;/a&gt; &lt;span class="counter"&gt;42&lt;/span&gt;
 </pre>
+
+          <p>Built-in styles are included for placing counters in active states in pill and list navigations.</p>
+          <div class="bs-docs-example">
+            <ul class="nav nav-pills">
+              <li class="active"><a href="#">Home <span class="counter">42</span></a></li>
+              <li><a href="#">Profile</a></li>
+              <li><a href="#">Messages <span class="counter">3</span></a></li>
+            </ul>
+            <br>
+            <ul class="nav nav-list" style="max-width: 260px;">
+              <li class="active">
+                <a href="#">
+                  <span class="counter pull-right">42</span>
+                  Home
+                </a>
+              </li>
+              <li><a href="#">Profile</a></li>
+              <li>
+                <a href="#">
+                  <span class="counter pull-right">3</span>
+                  Messages
+                </a>
+              </li>
+            </ul>
+          </div>
+<pre class="prettyprint linenums">
+&lt;ul class="nav nav-list"&gt;
+  &lt;li class="active"&gt;
+    &lt;a href="#"&gt;Home&lt;/a&gt;
+  &lt;/li&gt;
+  &lt;li&gt;&lt;a href="#"&gt;...&lt;/a&gt;&lt;/li&gt;
+  &lt;li&gt;&lt;a href="#"&gt;...&lt;/a&gt;&lt;/li&gt;
+&lt;/ul&gt;
+</pre>
+
           <h3>Easily collapsible</h3>
           <p>For easy implementation, counters will simply collapse (via CSS's <code>:empty</code> selector) when no content exists within.</p>
 
index 4b1b005bd164ded44dfa1d7c347bee2df97f3b96..bbaae5f1a03e400ed9a1f22b8befe33d20cd08ac 100644 (file)
             <h1>Counters</h1>
           </div>
 
+          <h3>Basic usage</h3>
+          <p>Counters are used to indicator unread or new items. Add a <code>&lt;span class="counter"&gt;</code> to links, Bootstrap navs, and more.</p>
           <div class="bs-docs-example">
             <a href="#">Inbox</a> <span class="counter">42</span>
           </div>
-
 <pre class="prettyprint linenums">
 &lt;a href="#"&gt;Inbox&lt;/a&gt; &lt;span class="counter"&gt;42&lt;/span&gt;
 </pre>
+
+          <p>Built-in styles are included for placing counters in active states in pill and list navigations.</p>
+          <div class="bs-docs-example">
+            <ul class="nav nav-pills">
+              <li class="active"><a href="#">Home <span class="counter">42</span></a></li>
+              <li><a href="#">Profile</a></li>
+              <li><a href="#">Messages <span class="counter">3</span></a></li>
+            </ul>
+            <br>
+            <ul class="nav nav-list" style="max-width: 260px;">
+              <li class="active">
+                <a href="#">
+                  <span class="counter pull-right">42</span>
+                  Home
+                </a>
+              </li>
+              <li><a href="#">Profile</a></li>
+              <li>
+                <a href="#">
+                  <span class="counter pull-right">3</span>
+                  Messages
+                </a>
+              </li>
+            </ul>
+          </div>
+<pre class="prettyprint linenums">
+&lt;ul class="nav nav-list"&gt;
+  &lt;li class="active"&gt;
+    &lt;a href="#"&gt;Home&lt;/a&gt;
+  &lt;/li&gt;
+  &lt;li&gt;&lt;a href="#"&gt;...&lt;/a&gt;&lt;/li&gt;
+  &lt;li&gt;&lt;a href="#"&gt;...&lt;/a&gt;&lt;/li&gt;
+&lt;/ul&gt;
+</pre>
+
           <h3>Easily collapsible</h3>
           <p>For easy implementation, counters will simply collapse (via CSS's <code>:empty</code> selector) when no content exists within.</p>
 
index 6f9cc00fc582fef1b37f2d93aacbd2f71d8f90c5..fc45fa2a66aa9796da19aad202a12a4f661d02f4 100644 (file)
@@ -6,18 +6,17 @@
 // Base classes
 .counter {
   display: inline-block;
-  padding: 2px 7px;
-  font-size: @font-size-base * .846;
+  min-width: 10px;
+  padding: 3px 7px;
+  font-size: 12px;
   font-weight: bold;
-  line-height: 14px; // ensure proper line-height if floated
   color: #fff;
-  vertical-align: baseline;
+  line-height: 1;
+  vertical-align: middle;
   white-space: nowrap;
-  text-shadow: 0 -1px 0 rgba(0,0,0,.25);
+  text-align: center;
   background-color: @grayLight;
   border-radius: 10px;
-  min-width: 10px;
-  text-align: center;
 
   // Empty labels/badges collapse
   &:empty {
@@ -46,3 +45,13 @@ a.counter {
     top: 0;
   }
 }
+
+// Account for counters in navs
+.nav-list > .active > a > .counter,
+.nav-pills > .active > a > .counter {
+  color: @link-color;
+  background-color: #fff;
+}
+.nav-pills > li > a > .counter {
+  margin-left: 3px;
+}
index 563cee42e7baaa0c03989479907655348c87536d..29062be48e5b02e8f3c9f1873990690d639c9a65 100644 (file)
@@ -65,12 +65,12 @@ h1, h2, h3, h4, h5, h6 {
 }
 
 h1,
-h2,
-h3 {
+h2 {
   margin-top: @line-height-base;
   margin-bottom: @line-height-base / 2;
   line-height: @line-height-base * 2;
 }
+h3,
 h4,
 h5,
 h6 {