Skip to content

Commit 2d571af

Browse files
authored
fix(material/stepper): icon not centered in header if direction changes (#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.
1 parent 93e09c6 commit 2d571af

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/material/stepper/step-header.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,16 @@
3737
position: relative;
3838
}
3939

40-
.mat-step-icon-content,
41-
.mat-step-icon .mat-icon {
40+
.mat-step-icon-content {
4241
// Use absolute positioning to center the content, because it works better with text.
4342
position: absolute;
4443
top: 50%;
4544
left: 50%;
4645
transform: translate(-50%, -50%);
46+
47+
// We aren't using any flex features here, but using the `display: flex` prevents
48+
// the browser from adding extra whitespace at the bottom of the element.
49+
display: flex;
4750
}
4851

4952
.mat-step-icon .mat-icon {

0 commit comments

Comments
 (0)