Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(expansion-panel): arrow not centered vertically and incorrect title font weight #10503

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/material/expansion/_expansion-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
}

.mat-expansion-panel-header-description,
.mat-expansion-indicator::after {
.mat-expansion-indicator {
color: mat-color($foreground, secondary-text);
}

Expand All @@ -67,4 +67,8 @@
.mat-expansion-panel-content {
@include mat-typography-level-to-styles($config, body-1);
}

.mat-expansion-panel-header-title {
font-weight: mat-font-weight($config, title);
}
}
7 changes: 5 additions & 2 deletions src/material/expansion/expansion-panel-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
<ng-content select="mat-panel-description"></ng-content>
<ng-content></ng-content>
</span>
<span [@indicatorRotate]="_getExpandedState()" *ngIf="_showToggle()"
class="mat-expansion-indicator"></span>

<svg [@indicatorRotate]="_getExpandedState()" *ngIf="_showToggle()"
class="mat-expansion-indicator" viewBox="0 0 24 24">
<path d="M7.41 7.84L12 12.42l4.59-4.58L18 9.25l-6 6-6-6z"/>
</svg>
15 changes: 4 additions & 11 deletions src/material/expansion/expansion-panel-header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,9 @@
flex-grow: 2;
}

/**
* Creates the expansion indicator arrow. Done using ::after rather than having
* additional nodes in the template.
*/
.mat-expansion-indicator::after {
border-style: solid;
border-width: 0 2px 2px 0;
content: '';
.mat-expansion-indicator {
display: inline-block;
padding: 3px;
transform: rotate(45deg);
vertical-align: middle;
width: 24px;
height: 24px;
fill: currentColor;
}