Skip to content

Commit

Permalink
refactor(typography): Rename typography Sass function from pxToRem() …
Browse files Browse the repository at this point in the history
…to px-to-rem()

BREAKING CHANGE: Renamed typography Sass function from pxToRem() to px-to-rem()

PiperOrigin-RevId: 368489085
  • Loading branch information
abhiomkar authored and copybara-github committed Apr 14, 2021
1 parent ab99b80 commit 8f0a11e
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions packages/mdc-typography/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
@return $tracking / ($font-size * 16) * 1em;
}

@function pxToRem($px) {
@function px-to-rem($px) {
@return $px / 16px * 1rem;
}

Expand Down Expand Up @@ -114,104 +114,104 @@ $styles: set-styles_(
$base,
(
headline1: (
font-size: pxToRem(96px),
line-height: pxToRem(96px),
font-size: px-to-rem(96px),
line-height: px-to-rem(96px),
font-weight: map.get($font-weight-values, light),
letter-spacing: get-letter-spacing_(-1.5, 6),
text-decoration: inherit,
text-transform: inherit,
),
headline2: (
font-size: pxToRem(60px),
line-height: pxToRem(60px),
font-size: px-to-rem(60px),
line-height: px-to-rem(60px),
font-weight: map.get($font-weight-values, light),
letter-spacing: get-letter-spacing_(-0.5, 3.75),
text-decoration: inherit,
text-transform: inherit,
),
headline3: (
font-size: pxToRem(48px),
line-height: pxToRem(50px),
font-size: px-to-rem(48px),
line-height: px-to-rem(50px),
font-weight: map.get($font-weight-values, regular),
letter-spacing: normal,
text-decoration: inherit,
text-transform: inherit,
),
headline4: (
font-size: pxToRem(34px),
line-height: pxToRem(40px),
font-size: px-to-rem(34px),
line-height: px-to-rem(40px),
font-weight: map.get($font-weight-values, regular),
letter-spacing: get-letter-spacing_(0.25, 2.125),
text-decoration: inherit,
text-transform: inherit,
),
headline5: (
font-size: pxToRem(24px),
line-height: pxToRem(32px),
font-size: px-to-rem(24px),
line-height: px-to-rem(32px),
font-weight: map.get($font-weight-values, regular),
letter-spacing: normal,
text-decoration: inherit,
text-transform: inherit,
),
headline6: (
font-size: pxToRem(20px),
line-height: pxToRem(32px),
font-size: px-to-rem(20px),
line-height: px-to-rem(32px),
font-weight: map.get($font-weight-values, medium),
letter-spacing: get-letter-spacing_(0.25, 1.25),
text-decoration: inherit,
text-transform: inherit,
),
subtitle1: (
font-size: pxToRem(16px),
line-height: pxToRem(28px),
font-size: px-to-rem(16px),
line-height: px-to-rem(28px),
font-weight: map.get($font-weight-values, regular),
letter-spacing: get-letter-spacing_(0.15, 1),
text-decoration: inherit,
text-transform: inherit,
),
subtitle2: (
font-size: pxToRem(14px),
line-height: pxToRem(22px),
font-size: px-to-rem(14px),
line-height: px-to-rem(22px),
font-weight: map.get($font-weight-values, medium),
letter-spacing: get-letter-spacing_(0.1, 0.875),
text-decoration: inherit,
text-transform: inherit,
),
body1: (
font-size: pxToRem(16px),
line-height: pxToRem(24px),
font-size: px-to-rem(16px),
line-height: px-to-rem(24px),
font-weight: map.get($font-weight-values, regular),
letter-spacing: get-letter-spacing_(0.5, 1),
text-decoration: inherit,
text-transform: inherit,
),
body2: (
font-size: pxToRem(14px),
line-height: pxToRem(20px),
font-size: px-to-rem(14px),
line-height: px-to-rem(20px),
font-weight: map.get($font-weight-values, regular),
letter-spacing: get-letter-spacing_(0.25, 0.875),
text-decoration: inherit,
text-transform: inherit,
),
caption: (
font-size: pxToRem(12px),
line-height: pxToRem(20px),
font-size: px-to-rem(12px),
line-height: px-to-rem(20px),
font-weight: map.get($font-weight-values, regular),
letter-spacing: get-letter-spacing_(0.4, 0.75),
text-decoration: inherit,
text-transform: inherit,
),
button: (
font-size: pxToRem(14px),
line-height: pxToRem(36px),
font-size: px-to-rem(14px),
line-height: px-to-rem(36px),
font-weight: map.get($font-weight-values, medium),
letter-spacing: get-letter-spacing_(1.25, 0.875),
text-decoration: none,
text-transform: uppercase,
),
overline: (
font-size: pxToRem(12px),
line-height: pxToRem(32px),
font-size: px-to-rem(12px),
line-height: px-to-rem(32px),
font-weight: map.get($font-weight-values, medium),
letter-spacing: get-letter-spacing_(2, 0.75),
text-decoration: none,
Expand Down

0 comments on commit 8f0a11e

Please sign in to comment.