Skip to content

Commit

Permalink
fix(material/stepper): icon not centered in header if direction chang…
Browse files Browse the repository at this point in the history
…es (#24131)

Fixes that the icon in the step header was being rendered outside of the circle of the page direction changes. This seems to be a browser rendering issue due to the fact that we were applying a `position: absolute` and a `transform` both on the icon and its parent. Since this is unnecessary, I've removed the styles from the icon and added an extra `display: flex` to fix the centering.

Fixes #24046.

(cherry picked from commit 2d571af)
  • Loading branch information
crisbeto authored and wagnermaciel committed Jan 6, 2022
1 parent 7705cae commit 2ca59f8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/material/stepper/step-header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@
position: relative;
}

.mat-step-icon-content,
.mat-step-icon .mat-icon {
.mat-step-icon-content {
// Use absolute positioning to center the content, because it works better with text.
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);

// We aren't using any flex features here, but using the `display: flex` prevents
// the browser from adding extra whitespace at the bottom of the element.
display: flex;
}

.mat-step-icon .mat-icon {
Expand Down

0 comments on commit 2ca59f8

Please sign in to comment.