Skip to content

Commit 053ac5c

Browse files
author
Sam Severance
committed
fix(expansion): fix expansion .mat-expansion-panel-header styles
* Add margin to `.mat-content` element to account for consumer using `mat-expansion-panel` components with the toggle hidden alongside `mat-expansion-panel` components where the toggle is visible * Adjust sizing of `.mat-expansion-panel-header-title` and `.mat-expansion-panel-header-description` elements so that the width of each respective element is uniform across multiple adjacent `mat-expansion-panel` elements * Fixes #20002
1 parent 0d43581 commit 053ac5c

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

src/components-examples/material/expansion/expansion-expand-collapse-all/expansion-expand-collapse-all-example.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
padding-bottom: 20px;
33
}
44

5-
.example-headers-align .mat-expansion-panel-header-title,
6-
.example-headers-align .mat-expansion-panel-header-description {
7-
flex-basis: 0;
8-
}
9-
105
.example-headers-align .mat-expansion-panel-header-description {
116
justify-content: space-between;
127
align-items: center;

src/components-examples/material/expansion/expansion-steps/expansion-steps-example.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
.example-headers-align .mat-expansion-panel-header-title,
2-
.example-headers-align .mat-expansion-panel-header-description {
3-
flex-basis: 0;
4-
}
5-
61
.example-headers-align .mat-expansion-panel-header-description {
72
justify-content: space-between;
83
align-items: center;

src/material/expansion/expansion-panel-header.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,23 @@
4545
flex: 1;
4646
flex-direction: row;
4747
overflow: hidden;
48+
49+
// width of .mat-expansion-indicator::after element
50+
&:only-child {
51+
margin-right: 8px;
52+
53+
[dir='rtl'] & {
54+
margin-right: 0;
55+
margin-left: 8px;
56+
}
57+
}
4858
}
4959

5060
.mat-expansion-panel-header-title,
5161
.mat-expansion-panel-header-description {
5262
display: flex;
5363
flex-grow: 1;
64+
flex-basis: 0;
5465
margin-right: 16px;
5566

5667
[dir='rtl'] & {

0 commit comments

Comments
 (0)