Skip to content

Commit f30609c

Browse files
josephperrottjelbourn
authored andcommitted
feat(typography): add letter-spacing configuration to typography configs. (#9932)
1 parent 9d19291 commit f30609c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/lib/core/typography/_typography-utils.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
@return _mat-get-type-value($config, $level, font-weight);
1919
}
2020

21+
// Gets the letter spacing for a level inside a typography config.
22+
@function mat-letter-spacing($config, $level) {
23+
@return _mat-get-type-value($config, $level, letter-spacing);
24+
}
25+
2126
// Gets the font-family from a typography config and removes the quotes around it.
2227
@function mat-font-family($config, $level: null) {
2328
$font-family: map-get($config, font-family);
@@ -64,4 +69,5 @@
6469
$font-family: mat-font-family($config, $level);
6570

6671
@include mat-typography-font-shorthand($font-size, $font-weight, $line-height, $font-family);
72+
letter-spacing: mat-letter-spacing($config, $level);
6773
}

src/lib/core/typography/_typography.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
$font-size,
66
$line-height: $font-size,
77
$font-weight: 400,
8-
$font-family: null) {
8+
$font-family: null,
9+
$letter-spacing: null) {
910

1011
@return (
1112
font-size: $font-size,
1213
line-height: $line-height,
1314
font-weight: $font-weight,
14-
font-family: $font-family
15+
font-family: $font-family,
16+
letter-spacing: $letter-spacing
1517
);
1618
}
1719

0 commit comments

Comments
 (0)