Skip to content

Commit

Permalink
Fixes twbs#11268: Account for badges within buttons by matching backg…
Browse files Browse the repository at this point in the history
…round to text color and text color to background
  • Loading branch information
mdo committed Dec 1, 2013
1 parent 359ac8f commit 6bc09dd
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
4 changes: 4 additions & 0 deletions components.html
Original file line number Diff line number Diff line change
Expand Up @@ -2697,6 +2697,10 @@ <h4>Adapts to active nav states</h4>
</a>
</li>
</ul>
<br>
<button class="btn btn-primary" type="button">
Messages <span class="badge">4</span>
</button>
</div>
{% highlight html %}
<ul class="nav nav-pills nav-stacked">
Expand Down
30 changes: 30 additions & 0 deletions dist/css/bootstrap.css
Original file line number Diff line number Diff line change
Expand Up @@ -2335,6 +2335,11 @@ fieldset[disabled] .btn-default.active {
border-color: #cccccc;
}

.btn-default .badge {
color: #ffffff;
background-color: #fff;
}

.btn-primary {
color: #ffffff;
background-color: #428bca;
Expand Down Expand Up @@ -2376,6 +2381,11 @@ fieldset[disabled] .btn-primary.active {
border-color: #357ebd;
}

.btn-primary .badge {
color: #428bca;
background-color: #fff;
}

.btn-warning {
color: #ffffff;
background-color: #f0ad4e;
Expand Down Expand Up @@ -2417,6 +2427,11 @@ fieldset[disabled] .btn-warning.active {
border-color: #eea236;
}

.btn-warning .badge {
color: #f0ad4e;
background-color: #fff;
}

.btn-danger {
color: #ffffff;
background-color: #d9534f;
Expand Down Expand Up @@ -2458,6 +2473,11 @@ fieldset[disabled] .btn-danger.active {
border-color: #d43f3a;
}

.btn-danger .badge {
color: #d9534f;
background-color: #fff;
}

.btn-success {
color: #ffffff;
background-color: #5cb85c;
Expand Down Expand Up @@ -2499,6 +2519,11 @@ fieldset[disabled] .btn-success.active {
border-color: #4cae4c;
}

.btn-success .badge {
color: #5cb85c;
background-color: #fff;
}

.btn-info {
color: #ffffff;
background-color: #5bc0de;
Expand Down Expand Up @@ -2540,6 +2565,11 @@ fieldset[disabled] .btn-info.active {
border-color: #46b8da;
}

.btn-info .badge {
color: #5bc0de;
background-color: #fff;
}

.btn-link {
font-weight: normal;
color: #428bca;
Expand Down
2 changes: 1 addition & 1 deletion dist/css/bootstrap.min.css

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions less/mixins.less
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,11 @@
border-color: @border;
}
}

.badge {
color: @background;
background-color: #fff;
}
}

// Button sizes
Expand Down

0 comments on commit 6bc09dd

Please sign in to comment.