Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit c50363d

Browse files
pndewitacdvorak
authored andcommitted
feat(typography): Support custom properties in mdc-typography mixin (#1664)
Apply all styles from `$mdc-typography-styles` instead of just a select set of properties. This allows users to override `$mdc-typography-styles` and add custom properties which will then be used everywhere. For example, adding `color` or a different `font-family`.
1 parent 4c68267 commit c50363d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

packages/mdc-typography/_mixins.scss

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,11 @@
3131

3232
@include mdc-typography-base;
3333

34-
font-size: map-get($style-props, font-size);
35-
font-weight: #{map-get($style-props, font-weight)};
36-
letter-spacing: map-get($style-props, letter-spacing);
37-
line-height: map-get($style-props, line-height);
38-
text-decoration: map-get($style-props, text-decoration);
39-
text-transform: map-get($style-props, text-transform);
34+
$style-props: map-remove($style-props, margin);
35+
36+
@each $key, $value in $style-props {
37+
#{$key}: $value;
38+
}
4039
}
4140

4241
@mixin mdc-typography-adjust-margin($style) {

0 commit comments

Comments
 (0)