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

PR : Accessibility - custom improvement - allow badge text color customisation #22363

Closed
wants to merge 10 commits into from
Closed
12 changes: 6 additions & 6 deletions scss/_badge.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,25 @@ a.badge {
// Contextual variations (linked badges get darker on :hover).

.badge-default {
@include badge-variant($badge-default-bg);
@include badge-variant($badge-default-bg,$badge-default-color);
}

.badge-primary {
@include badge-variant($badge-primary-bg);
@include badge-variant($badge-primary-bg,$badge-primary-color);
}

.badge-success {
@include badge-variant($badge-success-bg);
@include badge-variant($badge-success-bg,$badge-success-color);
}

.badge-info {
@include badge-variant($badge-info-bg);
@include badge-variant($badge-info-bg,$badge-info-color);
}

.badge-warning {
@include badge-variant($badge-warning-bg);
@include badge-variant($badge-warning-bg,$badge-warning-color);
}

.badge-danger {
@include badge-variant($badge-danger-bg);
@include badge-variant($badge-danger-bg,$badge-danger-color);
}
6 changes: 6 additions & 0 deletions scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -737,11 +737,17 @@ $popover-arrow-outer-color: fade-in($popover-border-color, .05) !defau
// Badges

$badge-default-bg: $gray-light !default;
$badge-default-color: $white !default;
$badge-primary-bg: $brand-primary !default;
$badge-primary-color: $white !default;
$badge-success-bg: $brand-success !default;
$badge-success-color: $white !default;
$badge-info-bg: $brand-info !default;
$badge-info-color: $white !default;
$badge-warning-bg: $brand-warning !default;
$badge-warning-color: $white !default;
$badge-danger-bg: $brand-danger !default;
$badge-danger-color: $white !default;

$badge-color: $white !default;
$badge-link-hover-color: $white !default;
Expand Down
5 changes: 3 additions & 2 deletions scss/mixins/_badge.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Badges

@mixin badge-variant($color) {
background-color: $color;
@mixin badge-variant($bgcolor,$color) {
background-color: $bgcolor;
color: $color;

&[href] {
@include hover-focus {
Expand Down