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: errors when defining typography with css variables #16475

Merged
merged 1 commit into from
Jul 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/material/core/typography/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@
// and h6 at 0.67em.
.mat-h5, #{$selector} h5 {
@include mat-typography-font-shorthand(
mat-font-size($config, body-1) * 0.83,
// calc is used here to support css variables
calc(#{mat-font-size($config, body-1)} * 0.83),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment that explains the use of calc here? I could see someone removing it without considering CSS variables.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

mat-font-weight($config, body-1),
mat-line-height($config, body-1),
mat-font-family($config, body-1)
Expand All @@ -107,7 +108,8 @@

.mat-h6, #{$selector} h6 {
@include mat-typography-font-shorthand(
mat-font-size($config, body-1) * 0.67,
// calc is used here to support css variables
calc(#{mat-font-size($config, body-1)} * 0.67),
mat-font-weight($config, body-1),
mat-line-height($config, body-1),
mat-font-family($config, body-1)
Expand Down