|
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
|
|
47 | 53 | font-weight: $font-weight;
|
48 | 54 | line-height: $line-height;
|
49 | 55 | font-family: $font-family;
|
| 56 | + letter-spacing: $letter-spacing; |
50 | 57 | }
|
51 | 58 | @else {
|
52 | 59 | // Otherwise use the shorthand `font`, because it's the least amount of bytes. Note
|
|
62 | 69 | $font-weight: mat-font-weight($config, $level);
|
63 | 70 | $line-height: mat-line-height($config, $level);
|
64 | 71 | $font-family: mat-font-family($config, $level);
|
| 72 | + $letter-spacing: mat-letter-spacing($config, $level); |
65 | 73 |
|
66 |
| - @include mat-typography-font-shorthand($font-size, $font-weight, $line-height, $font-family); |
| 74 | + @include mat-typography-font-shorthand( |
| 75 | + $font-size, $font-weight, $line-height, $font-family, $letter-spacing); |
67 | 76 | }
|
0 commit comments