Skip to content

fix(typography): move header letter spacing into typography config #15210

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

Merged
merged 1 commit into from
Feb 22, 2019
Merged
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
13 changes: 5 additions & 8 deletions src/lib/core/typography/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@

// Represents a collection of typography levels.
// Defaults come from https://material.io/guidelines/style/typography.html
// Note: The spec doesn't mention letter spacing. The values here come from
// eyeballing it until it looked exactly like the spec examples.
@function mat-typography-config(
$font-family: 'Roboto, "Helvetica Neue", sans-serif',
$display-4: mat-typography-level(112px, 112px, 300),
$display-3: mat-typography-level(56px, 56px, 400),
$display-2: mat-typography-level(45px, 48px, 400),
$display-4: mat-typography-level(112px, 112px, 300, $letter-spacing: -0.05em),
$display-3: mat-typography-level(56px, 56px, 400, $letter-spacing: -0.02em),
$display-2: mat-typography-level(45px, 48px, 400, $letter-spacing: -0.005em),
$display-1: mat-typography-level(34px, 40px, 400),
$headline: mat-typography-level(24px, 32px, 400),
$title: mat-typography-level(20px, 32px, 500),
Expand Down Expand Up @@ -130,24 +132,19 @@
@include mat-typography-level-to-styles($config, caption);
}

// Note: The spec doesn't mention letter spacing. The value comes from
// eyeballing it until it looked exactly like the spec examples.
.mat-display-4, #{$selector} .mat-display-4 {
@include mat-typography-level-to-styles($config, display-4);
margin: 0 0 56px;
letter-spacing: -0.05em;
}

.mat-display-3, #{$selector} .mat-display-3 {
@include mat-typography-level-to-styles($config, display-3);
margin: 0 0 64px;
letter-spacing: -0.02em;
}

.mat-display-2, #{$selector} .mat-display-2 {
@include mat-typography-level-to-styles($config, display-2);
margin: 0 0 64px;
letter-spacing: -0.005em;
}

.mat-display-1, #{$selector} .mat-display-1 {
Expand Down