Skip to content

Commit

Permalink
fix(material/button): incorrect outlined focus overlay shape when bor…
Browse files Browse the repository at this point in the history
…der radius is customized

Fixes that the focus overlay on outlined buttons wasn't covering the outlined button fully when its border radius is customized.

Fixes #30484.
  • Loading branch information
crisbeto committed Feb 24, 2025
1 parent 8b2b944 commit 9701763
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
5 changes: 2 additions & 3 deletions src/material/button/button-high-contrast.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
@use '@angular/cdk';

// Add an outline to make buttons more visible in high contrast mode. Stroked buttons and FABs
// don't need a special look in high-contrast mode, because those already have an outline.
.mat-mdc-button:not(.mdc-button--outlined),
.mat-mdc-unelevated-button:not(.mdc-button--outlined),
.mat-mdc-raised-button:not(.mdc-button--outlined),
.mat-mdc-outlined-button:not(.mdc-button--outlined),
.mat-mdc-icon-button.mat-mdc-icon-button {
.mat-mdc-icon-button.mat-mdc-icon-button,
.mat-mdc-outlined-button .mdc-button__ripple {
@include cdk.high-contrast {
outline: solid 1px;
}
Expand Down
8 changes: 0 additions & 8 deletions src/material/button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,6 @@
@include token-utils.create-token-slot(color, disabled-label-text-color);
@include token-utils.create-token-slot(border-color, disabled-outline-color);
}

// TODO(crisbeto): this causes a weird gap between the ripple and the
// outline. We should remove it and update the screenshot tests.
.mdc-button__ripple {
@include token-utils.create-token-slot(border-width, outline-width);
border-style: solid;
border-color: transparent;
}
}
}

Expand Down

0 comments on commit 9701763

Please sign in to comment.