Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds button styles to .list-group-item #16215

Merged
merged 3 commits into from
May 14, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/_includes/components/list-group.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,27 @@ <h2 id="list-group-linked">Linked items</h2>
<a href="#" class="list-group-item">Porta ac consectetur ac</a>
<a href="#" class="list-group-item">Vestibulum at eros</a>
</div>
{% endhighlight %}

<h2 id="list-group-buttons">Button items</h2>
<p>List group items may be buttons instead of list items (that also means a parent <code>&lt;div&gt;</code> instead of an <code>&lt;ul&gt;</code>). No need for individual parents around each element. <strong class="text-danger">Don't use the standard <code>.btn</code> classes here.</strong></p>
<div class="bs-example" data-example-id="list-group-btns">
<div class="list-group">
<button class="list-group-item">Cras justo odio</button>
<button class="list-group-item">Dapibus ac facilisis in</button>
<button class="list-group-item">Morbi leo risus</button>
<button class="list-group-item">Porta ac consectetur ac</button>
<button class="list-group-item">Vestibulum at eros</button>
</div>
</div>
{% highlight html %}
<div class="list-group">
<button class="list-group-item">Cras justo odio</button>
<button class="list-group-item">Dapibus ac facilisis in</button>
<button class="list-group-item">Morbi leo risus</button>
<button class="list-group-item">Porta ac consectetur ac</button>
<button class="list-group-item">Vestibulum at eros</button>
</div>
{% endhighlight %}

<h2 id="list-group-disabled">Disabled items</h2>
Expand Down
1 change: 1 addition & 0 deletions docs/_includes/nav/components.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
<li><a href="#list-group-basic">Basic example</a></li>
<li><a href="#list-group-badges">Badges</a></li>
<li><a href="#list-group-linked">Linked items</a></li>
<li><a href="#list-group-buttons">Button items</a></li>
<li><a href="#list-group-disabled">Disabled items</a></li>
<li><a href="#list-group-contextual-classes">Contextual classes</a></li>
<li><a href="#list-group-custom-content">Custom content</a></li>
Expand Down
12 changes: 9 additions & 3 deletions less/list-group.less
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@
}


// Linked list items
// Interactive list items
//
// Use anchor elements instead of `li`s or `div`s to create linked list items.
// Use anchor or button elements instead of `li`s or `div`s to create interactive items.
// Includes an extra `.active` modifier class for showing selected items.

a.list-group-item {
a.list-group-item,
button.list-group-item {
color: @list-group-link-color;

.list-group-item-heading {
Expand All @@ -59,6 +60,11 @@ a.list-group-item {
}
}

button.list-group-item {
width: 100%;
text-align: left;
}

.list-group-item {
// Disabled state
&.disabled,
Expand Down
3 changes: 2 additions & 1 deletion less/mixins/list-group.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
color: @color;
background-color: @background;

a& {
a&,
button& {
color: @color;

.list-group-item-heading {
Expand Down