|
18 | 18 | @return _mat-get-type-value($config, $level, font-weight);
|
19 | 19 | }
|
20 | 20 |
|
| 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 | + |
21 | 26 | // Gets the font-family from a typography config and removes the quotes around it.
|
22 | 27 | @function mat-font-family($config, $level: null) {
|
23 | 28 | $font-family: map-get($config, font-family);
|
|
31 | 36 |
|
32 | 37 | // Outputs the shorthand `font` CSS property, based on a set of typography values. Falls back to
|
33 | 38 | // the individual properties if a value that isn't allowed in the shorthand is passed in.
|
34 |
| -@mixin mat-typography-font-shorthand($font-size, $font-weight, $line-height, $font-family) { |
| 39 | +@mixin mat-typography-font-shorthand( |
| 40 | + $font-size, $font-weight, $line-height, $font-family, $letter-spacing) { |
35 | 41 | // If any of the values are set to `inherit`, we can't use the shorthand
|
36 | 42 | // so we fall back to passing in the individual properties.
|
37 | 43 | @if ($font-size == inherit or
|
|
54 | 60 | // Sass from dividing the two values.
|
55 | 61 | font: $font-weight #{$font-size}/#{$line-height} $font-family;
|
56 | 62 | }
|
| 63 | + // Set the letter spacing regardless of method for setting font values. |
| 64 | + letter-spacing: $letter-spacing; |
57 | 65 | }
|
58 | 66 |
|
59 | 67 | // Converts a typography level into CSS styles.
|
|
62 | 70 | $font-weight: mat-font-weight($config, $level);
|
63 | 71 | $line-height: mat-line-height($config, $level);
|
64 | 72 | $font-family: mat-font-family($config, $level);
|
| 73 | + $letter-spacing: mat-letter-spacing($config, $level); |
65 | 74 |
|
66 |
| - @include mat-typography-font-shorthand($font-size, $font-weight, $line-height, $font-family); |
| 75 | + @include mat-typography-font-shorthand( |
| 76 | + $font-size, $font-weight, $line-height, $font-family, $letter-spacing); |
67 | 77 | }
|
0 commit comments