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

Fix missing active state for outline buttons #39099

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
16 changes: 15 additions & 1 deletion scss/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,21 @@

@each $color, $value in $theme-colors {
.btn-outline-#{$color} {
@include button-outline-variant($value);
@if $color == "light" {
@include button-outline-variant(
$value,
$hover-background: shade-color($value, $btn-hover-bg-shade-amount),
$active-background: shade-color($value, $btn-active-bg-shade-amount)
);
} @else if $color == "dark" {
@include button-outline-variant(
$value,
$hover-background: tint-color($value, $btn-hover-bg-tint-amount),
$active-background: tint-color($value, $btn-active-bg-tint-amount)
);
} @else {
@include button-outline-variant($value);
}
}
}
// scss-docs-end btn-variant-loops
Expand Down
15 changes: 9 additions & 6 deletions scss/mixins/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,19 @@
// scss-docs-start btn-outline-variant-mixin
@mixin button-outline-variant(
$color,
$color-hover: color-contrast($color),
$active-background: $color,
$active-border: $color,
$color-contrast: color-contrast($color),
$hover-background: if($color-contrast == $color-contrast-light, shade-color($color, $btn-hover-bg-shade-amount), tint-color($color, $btn-hover-bg-tint-amount)),
$hover-border: $hover-background,
$hover-color: color-contrast($hover-background),
$active-background: if($color-contrast == $color-contrast-light, shade-color($color, $btn-active-bg-shade-amount), tint-color($color, $btn-active-bg-tint-amount)),
$active-border: $active-background,
$active-color: color-contrast($active-background)
) {
--#{$prefix}btn-color: #{$color};
--#{$prefix}btn-border-color: #{$color};
--#{$prefix}btn-hover-color: #{$color-hover};
--#{$prefix}btn-hover-bg: #{$active-background};
--#{$prefix}btn-hover-border-color: #{$active-border};
--#{$prefix}btn-hover-color: #{$hover-color};
--#{$prefix}btn-hover-bg: #{$hover-background};
--#{$prefix}btn-hover-border-color: #{$hover-border};
--#{$prefix}btn-focus-shadow-rgb: #{to-rgb($color)};
--#{$prefix}btn-active-color: #{$active-color};
--#{$prefix}btn-active-bg: #{$active-background};
Expand Down