Skip to content

Commit

Permalink
fixes #10316: Document .active and :active for buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
mdo committed Sep 1, 2013
1 parent 741e0fc commit 14b3a35
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions _includes/nav-css.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
<ul class="nav">
<li><a href="#buttons-options">Options</a></li>
<li><a href="#buttons-sizes">Sizes</a></li>
<li><a href="#buttons-active">Active state</a></li>
<li><a href="#buttons-disabled">Disabled state</a></li>
<li><a href="#buttons-tags">Button tags</a></li>
</ul>
Expand Down
26 changes: 26 additions & 0 deletions css.html
Original file line number Diff line number Diff line change
Expand Up @@ -2112,6 +2112,32 @@ <h2 id="buttons-sizes">Sizes</h2>
{% endhighlight %}


<h2 id="buttons-active">Active state</h2>
<p>Buttons will appear pressed (with a darker background, darker border, and inset shadow) when active. For <code>&lt;button&gt;</code> elements, this is done via <code>:active</code>. For <code>&lt;a&gt;</code> elements, it's done with <code>.active</code>. However, you may use <code>.active</code> <code>&lt;button&gt;</code>s should you need to replicate the active state progammatically.</p>

<h3>Button element</h3>
<p>No need to add <code>:active</code> as it's a pseudo state, but if you need it, go ahead and add <code>.active</code>.</p>
<p class="bs-example">
<button type="button" class="btn btn-primary btn-lg active">Primary button</button>
<button type="button" class="btn btn-default btn-lg active">Button</button>
</p>
{% highlight html %}
<button type="button" class="btn btn-primary btn-lg active">Primary button</button>
<button type="button" class="btn btn-default btn-lg active">Button</button>
{% endhighlight %}

<h3>Anchor element</h3>
<p>Add the <code>.active</code> class to <code>&lt;a&gt;</code> buttons.</p>
<p class="bs-example">
<a href="#" class="btn btn-primary btn-lg active" role="button">Primary link</a>
<a href="#" class="btn btn-default btn-lg active" role="button">Link</a>
</p>
{% highlight html %}
<a href="#" class="btn btn-primary btn-lg active" role="button">Primary link</a>
<a href="#" class="btn btn-default btn-lg active" role="button">Link</a>
{% endhighlight %}


<h2 id="buttons-disabled">Disabled state</h2>
<p>Make buttons look unclickable by fading them back 50%.</p>

Expand Down

0 comments on commit 14b3a35

Please sign in to comment.