Skip to content

Commit

Permalink
refactor(material/button): clean up margin reset (angular#27954)
Browse files Browse the repository at this point in the history
When tokenizing the text buttons, I found an issue where MDC previously was resetting the margin of buttons on lower densities. This is something that goes against our coding standards since we don't want to affect anything outside of the component.

(cherry picked from commit 8a01967)
  • Loading branch information
crisbeto committed Oct 18, 2023
1 parent 31143dd commit b9204d3
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/material/button/_button-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -231,16 +231,6 @@
$density-tokens: tokens-mdc-text-button.get-density-tokens($theme);
@include mdc-button-text-theme.theme($density-tokens);
@include button-theme-private.touch-target-density($density-scale);

// TODO(crisbeto): before the introduction of tokens, MDC's density mixin was adding
// `margin-top: 0` and `margin-bottom: 0` in its `density` mixin which a lot of internal
// clients came to depend upon. Preserve it to make tokens easier to land.
@if ($density-scale < 0) {
&.mat-mdc-button-base {
margin-top: 0;
margin-bottom: 0;
}
}
}

.mat-mdc-raised-button {
Expand Down

0 comments on commit b9204d3

Please sign in to comment.