Skip to content

Commit 0673574

Browse files
crisbetojelbourn
authored andcommitted
fix(typography): move header letter spacing into typography config (#15210)
Currently the letter spacing for some of the headers is hardcoded in the styles themselves. These changes move it into the config so it can be overwritten. Fixes #15197.
1 parent dfa40fc commit 0673574

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/lib/core/typography/_typography.scss

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@
1919

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

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

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

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

153150
.mat-display-1, #{$selector} .mat-display-1 {

0 commit comments

Comments
 (0)