Skip to content

Commit

Permalink
fix(material/button): add specificity to icon button density (#26911)
Browse files Browse the repository at this point in the history
(cherry picked from commit 464aaf6)
  • Loading branch information
andrewseguin committed Apr 14, 2023
1 parent f8a70bf commit e092663
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/material/button/_icon-button-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,14 @@ $_icon-size: 24px;
$property-name: size,
);

.mat-mdc-icon-button {
@include mdc-icon-button-theme.theme((
state-layer-size: $calculated-size,
));
}

// Use `mat-mdc-button-base` to increase the specificity over the button's structural styles.
.mat-mdc-icon-button.mat-mdc-button-base {
// Match the styles that used to be present. This is necessary for backwards
// compat to match the previous implementations selector count (two classes).
@include mdc-icon-button-theme.theme((
state-layer-size: $calculated-size,
));

// TODO: Switch calculated-size to "var(--mdc-icon-button-state-layer-size)"
// Currently fails validation because the variable is "undefined"
// in the sass stack.
Expand Down

0 comments on commit e092663

Please sign in to comment.