Skip to content

feat(typography): add letter-spacing configuration to typography config #9932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/lib/core/typography/_typography-utils.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
6 changes: 4 additions & 2 deletions src/lib/core/typography/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be consumed somewhere?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, didn't include that file for some reason.

);
}

Expand Down