Skip to content

Commit

Permalink
Merge pull request #9123 from twbs/bs3_alerts_default_class
Browse files Browse the repository at this point in the history
Update labels to include a base class (fixes #8752)
  • Loading branch information
mdo committed Aug 6, 2013
2 parents ac3cb69 + 219f0fe commit 1d1e21a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 13 deletions.
18 changes: 9 additions & 9 deletions components.html
Original file line number Diff line number Diff line change
Expand Up @@ -1629,28 +1629,28 @@ <h1 id="labels">Labels</h1>

<h3>Example</h3>
<div class="bs-example">
<h1>Example heading <span class="label">New</span></h1>
<h2>Example heading <span class="label">New</span></h2>
<h3>Example heading <span class="label">New</span></h3>
<h4>Example heading <span class="label">New</span></h4>
<h5>Example heading <span class="label">New</span></h5>
<h6>Example heading <span class="label">New</span></h6>
<h1>Example heading <span class="label label-default">New</span></h1>
<h2>Example heading <span class="label label-default">New</span></h2>
<h3>Example heading <span class="label label-default">New</span></h3>
<h4>Example heading <span class="label label-default">New</span></h4>
<h5>Example heading <span class="label label-default">New</span></h5>
<h6>Example heading <span class="label label-default">New</span></h6>
</div>
{% highlight html %}
<h3>Example heading <span class="label">New</span></h3>
<h3>Example heading <span class="label label-default">New</span></h3>
{% endhighlight %}

<h3>Available variations</h3>
<p>Add any of the below mentioned modifier classes to change the appearance of a label.</p>
<div class="bs-example">
<span class="label">Default</span>
<span class="label label-default">Default</span>
<span class="label label-success">Success</span>
<span class="label label-warning">Warning</span>
<span class="label label-danger">Danger</span>
<span class="label label-info">Info</span>
</div>
{% highlight html %}
<span class="label">Default</span>
<span class="label label-default">Default</span>
<span class="label label-success">Success</span>
<span class="label label-warning">Warning</span>
<span class="label label-danger">Danger</span>
Expand Down
9 changes: 8 additions & 1 deletion dist/css/bootstrap.css
Original file line number Diff line number Diff line change
Expand Up @@ -4073,7 +4073,6 @@ a.thumbnail:focus {
text-align: center;
white-space: nowrap;
vertical-align: baseline;
background-color: #999999;
border-radius: .25em;
}

Expand All @@ -4082,6 +4081,14 @@ a.thumbnail:focus {
color: #ffffff;
text-decoration: none;
cursor: pointer;
}

.label-default {
background-color: #999999;
}

.label-default[href]:hover,
.label-default[href]:focus {
background-color: #808080;
}

Expand Down
2 changes: 1 addition & 1 deletion dist/css/bootstrap.min.css

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions less/labels.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
text-align: center;
white-space: nowrap;
vertical-align: baseline;
background-color: @gray-light;
border-radius: .25em;

// Add hover effects, but only for links
Expand All @@ -22,13 +21,17 @@
color: @label-link-hover-color;
text-decoration: none;
cursor: pointer;
background-color: darken(@gray-light, 10%);
}
}
}

// Colors
// Contextual variations (linked labels get darker on :hover)

.label-default {
.label-variant(@label-default-bg);
}

.label-danger {
.label-variant(@label-danger-bg);
}
Expand Down
2 changes: 2 additions & 0 deletions less/variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@

// Labels
// -------------------------

@label-default-bg: @gray-light;
@label-success-bg: @brand-success;
@label-info-bg: @brand-info;
@label-warning-bg: @brand-warning;
Expand Down

0 comments on commit 1d1e21a

Please sign in to comment.