From f30609ce48c9fc5135ec02b3fbf0e6100328229e Mon Sep 17 00:00:00 2001 From: Joey Perrott Date: Sat, 17 Feb 2018 17:12:19 -0800 Subject: [PATCH] feat(typography): add letter-spacing configuration to typography configs. (#9932) --- src/lib/core/typography/_typography-utils.scss | 6 ++++++ src/lib/core/typography/_typography.scss | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/lib/core/typography/_typography-utils.scss b/src/lib/core/typography/_typography-utils.scss index 9ad5def4de3..1af1d0504ef 100644 --- a/src/lib/core/typography/_typography-utils.scss +++ b/src/lib/core/typography/_typography-utils.scss @@ -18,6 +18,11 @@ @return _mat-get-type-value($config, $level, font-weight); } +// Gets the letter spacing for a level inside a typography config. +@function mat-letter-spacing($config, $level) { + @return _mat-get-type-value($config, $level, letter-spacing); +} + // Gets the font-family from a typography config and removes the quotes around it. @function mat-font-family($config, $level: null) { $font-family: map-get($config, font-family); @@ -64,4 +69,5 @@ $font-family: mat-font-family($config, $level); @include mat-typography-font-shorthand($font-size, $font-weight, $line-height, $font-family); + letter-spacing: mat-letter-spacing($config, $level); } diff --git a/src/lib/core/typography/_typography.scss b/src/lib/core/typography/_typography.scss index 0880c8d352c..f20fb5e70fa 100644 --- a/src/lib/core/typography/_typography.scss +++ b/src/lib/core/typography/_typography.scss @@ -5,13 +5,15 @@ $font-size, $line-height: $font-size, $font-weight: 400, - $font-family: null) { + $font-family: null, + $letter-spacing: null) { @return ( font-size: $font-size, line-height: $line-height, font-weight: $font-weight, - font-family: $font-family + font-family: $font-family, + letter-spacing: $letter-spacing ); }