Skip to content
This repository was archived by the owner on Nov 26, 2024. It is now read-only.

Conversation

@garrettbear
Copy link
Contributor

Switch REM based line height to match exactly with design

  --line-height-1: 1rem; // 16px
  --line-height-2: 1.25rem; // 20px
  --line-height-3: 1.375rem; // 22px
  --line-height-4: 1.5rem; // 24px
  --line-height-5: 2rem; // 32px
  --line-height-6: 2.5rem; // 40px
  --line-height-7: 3.5rem; // 56px

@garrettbear garrettbear requested a review from a team as a code owner August 4, 2022 00:15
Copy link
Collaborator

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

LGTM! Nice work 💯

NidhiKJha
NidhiKJha previously approved these changes Aug 4, 2022
Copy link
Member

@NidhiKJha NidhiKJha left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@garrettbear garrettbear dismissed stale reviews from NidhiKJha and georgewrmarshall via 5d9d148 August 4, 2022 20:38
@metamaskbot
Copy link
Collaborator

Builds ready [5d9d148]

Copy link
Collaborator

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

Could you add a screenshot of the typography ramps using the css vars compared to the CSS in JS so we can ensure they are the same? Hmm or even a couple of stories?

Screen Shot 2022-08-04 at 8 28 51 AM

Screen Shot 2022-08-04 at 8 29 22 AM

Heres the way I did it to check the SmallScreen css vars

export const SmallScreen: ComponentStory<typeof Text> = (...args) => {
  const smallScreenFontSizeBase = 16;
  const jsObject = {
    displayMD: {
      fontFamily: typography.sDisplayMD.fontFamily,
      fontSize: typography.sDisplayMD.fontSize,
      lineHeight: `${typography.sDisplayMD.lineHeight}px`,
      fontWeight: typography.sDisplayMD.fontWeight,
    },
    headingLG: {
      fontFamily: typography.sHeadingLG.fontFamily,
      fontSize: typography.sHeadingLG.fontSize,
      lineHeight: `${typography.sHeadingLG.lineHeight}px`,
      fontWeight: typography.sHeadingLG.fontWeight,
    },
    headingMD: {
      fontFamily: typography.sHeadingMD.fontFamily,
      fontSize: typography.sHeadingMD.fontSize,
      lineHeight: `${typography.sHeadingMD.lineHeight}px`,
      fontWeight: typography.sHeadingMD.fontWeight,
    },
    headingSM: {
      fontFamily: typography.sHeadingSM.fontFamily,
      fontSize: typography.sHeadingSM.fontSize,
      lineHeight: `${typography.sHeadingSM.lineHeight}px`,
      fontWeight: typography.sHeadingSM.fontWeight,
    },
    headingSMRegular: {
      fontFamily: typography.sHeadingSMRegular.fontFamily,
      fontSize: typography.sHeadingSMRegular.fontSize,
      lineHeight: `${typography.sHeadingSMRegular.lineHeight}px`,
      fontWeight: typography.sHeadingSMRegular.fontWeight,
    },
    bodyMD: {
      fontFamily: typography.sBodyMD.fontFamily,
      fontSize: typography.sBodyMD.fontSize,
      lineHeight: `${typography.sBodyMD.lineHeight}px`,
      fontWeight: typography.sBodyMD.fontWeight,
    },
    bodyMDBold: {
      fontFamily: typography.sBodyMDBold.fontFamily,
      fontSize: typography.sBodyMDBold.fontSize,
      lineHeight: `${typography.sBodyMDBold.lineHeight}px`,
      fontWeight: typography.sBodyMDBold.fontWeight,
    },
    bodySM: {
      fontFamily: typography.sBodySM.fontFamily,
      fontSize: typography.sBodySM.fontSize,
      lineHeight: `${typography.sBodySM.lineHeight}px`,
      fontWeight: typography.sBodySM.fontWeight,
    },
    bodySMBold: {
      fontFamily: typography.sBodySMBold.fontFamily,
      fontSize: typography.sBodySMBold.fontSize,
      lineHeight: `${typography.sBodySMBold.lineHeight}px`,
      fontWeight: typography.sBodySMBold.fontWeight,
    },
    bodyXS: {
      fontFamily: typography.sBodyXS.fontFamily,
      fontSize: typography.sBodyXS.fontSize,
      lineHeight: `${typography.sBodyXS.lineHeight}px`,
      fontWeight: typography.sBodyXS.fontWeight,
      letterSpacing: typography.sBodyXS.letterSpacing,
    },
  };

  const styles = {
    displayMD: {
      fontFamily: 'var(--typography-s-display-md-font-family)',
      fontSize: 'var(--typography-s-display-md-font-size)',
      lineHeight: 'var(--typography-s-display-md-line-height)',
      fontWeight: 'var(--typography-s-display-md-font-weight)',
    },
    headingLG: {
      fontFamily: 'var(--typography-s-heading-lg-font-family)',
      fontSize: 'var(--typography-s-heading-lg-font-size)',
      lineHeight: 'var(--typography-s-heading-lg-line-height)',
      fontWeight: 'var(--typography-s-heading-lg-font-weight)',
    },
    headingMD: {
      fontFamily: 'var(--typography-s-heading-md-font-family)',
      fontSize: 'var(--typography-s-heading-md-font-size)',
      lineHeight: 'var(--typography-s-heading-md-line-height)',
      fontWeight: 'var(--typography-s-heading-md-font-weight)',
    },
    headingSM: {
      fontFamily: 'var(--typography-s-heading-sm-font-family)',
      fontSize: 'var(--typography-s-heading-sm-font-size)',
      lineHeight: 'var(--typography-s-heading-sm-line-height)',
      fontWeight: 'var(--typography-s-heading-sm-font-weight)',
    },
    headingSMRegular: {
      fontFamily: 'var(--typography-s-heading-sm-regular-font-family)',
      fontSize: 'var(--typography-s-heading-sm-regular-font-size)',
      lineHeight: 'var(--typography-s-heading-sm-regular-line-height)',
      fontWeight: 'var(--typography-s-heading-sm-regular-font-weight)',
    },
    bodyMD: {
      fontFamily: 'var(--typography-s-body-md-font-family)',
      fontSize: 'var(--typography-s-body-md-font-size)',
      lineHeight: 'var(--typography-s-body-md-line-height)',
      fontWeight: 'var(--typography-s-body-md-font-weight)',
    },
    bodyMDBold: {
      fontFamily: 'var(--typography-s-body-md-bold-font-family)',
      fontSize: 'var(--typography-s-body-md-bold-font-size)',
      lineHeight: 'var(--typography-s-body-md-bold-line-height)',
      fontWeight: 'var(--typography-s-body-md-bold-font-weight)',
    },
    bodySM: {
      fontFamily: 'var(--typography-s-body-sm-font-family)',
      fontSize: 'var(--typography-s-body-sm-font-size)',
      lineHeight: 'var(--typography-s-body-sm-line-height)',
      fontWeight: 'var(--typography-s-body-sm-font-weight)',
    },
    bodySMBold: {
      fontFamily: 'var(--typography-s-body-sm-bold-font-family)',
      fontSize: 'var(--typography-s-body-sm-bold-font-size)',
      lineHeight: 'var(--typography-s-body-sm-bold-line-height)',
      fontWeight: 'var(--typography-s-body-sm-bold-font-weight)',
    },
    bodyXS: {
      fontFamily: 'var(--typography-s-body-xs-font-family)',
      fontSize: 'var(--typography-s-body-xs-font-size)',
      lineHeight: 'var(--typography-s-body-xs-line-height)',
      fontWeight: 'var(--typography-s-body-xs-font-weight)',
      letterSpacing: 'var(--typography-s-body-xs-letter-spacing)',
    },
  };

  return (
    <>
      <Text as="h1" style={styles.displayMD} {...args}>
        {`S DisplayMD ${jsObject.displayMD.fontSize}px/${
          jsObject.displayMD.lineHeight
        } ${jsObject.displayMD.fontSize / smallScreenFontSizeBase}rem`}
      </Text>
      <Text as="h2" style={styles.headingLG} {...args}>
        {`S HeadingLG ${jsObject.headingLG.fontSize}px/${
          jsObject.headingLG.lineHeight
        } ${jsObject.headingLG.fontSize / smallScreenFontSizeBase}rem`}
      </Text>
      <Text as="h3" style={styles.headingMD} {...args}>
        {`S HeadingMD ${jsObject.headingMD.fontSize}px/${
          jsObject.headingMD.lineHeight
        } ${jsObject.headingMD.fontSize / smallScreenFontSizeBase}rem`}
      </Text>
      <Text as="h4" style={styles.headingSM} {...args}>
        {`S HeadingSM ${jsObject.headingSM.fontSize}px/${
          jsObject.headingSM.lineHeight
        } ${jsObject.headingSM.fontSize / smallScreenFontSizeBase}rem`}
      </Text>
      <Text as="h4" style={styles.headingSMRegular} {...args}>
        {`S HeadingSM Regular ${jsObject.headingSMRegular.fontSize}px/${
          jsObject.headingSMRegular.lineHeight
        } ${jsObject.headingSMRegular.fontSize / smallScreenFontSizeBase}rem`}
      </Text>
      <Text as="p" style={styles.bodyMDBold} {...args}>
        {`S BodyMD Bold ${jsObject.bodyMDBold.fontSize}px/${
          jsObject.bodyMDBold.lineHeight
        } ${jsObject.bodyMDBold.fontSize / smallScreenFontSizeBase}rem`}
      </Text>
      <Text as="p" style={styles.bodyMD} {...args}>
        {`S BodyMD ${jsObject.bodyMD.fontSize}px/${
          jsObject.bodyMD.lineHeight
        } ${jsObject.bodyMD.fontSize / smallScreenFontSizeBase}rem`}
      </Text>
      <Text as="p" style={styles.bodySMBold} {...args}>
        {`S BodySM Bold ${jsObject.bodySMBold.fontSize}px/${
          jsObject.bodySMBold.lineHeight
        } ${jsObject.bodySMBold.fontSize / smallScreenFontSizeBase}rem`}
      </Text>
      <Text as="p" style={styles.bodySM} {...args}>
        {`S BodySM ${jsObject.bodySM.fontSize}px/${
          jsObject.bodySM.lineHeight
        } ${jsObject.bodySM.fontSize / smallScreenFontSizeBase}rem`}
      </Text>
      <Text as="p" style={styles.bodyXS} {...args}>
        {`S BodyXS ${jsObject.bodyXS.fontSize}px/${
          jsObject.bodyXS.lineHeight
        } ${jsObject.bodyXS.fontSize / smallScreenFontSizeBase}rem`}
      </Text>
    </>
  );
};

@garrettbear garrettbear force-pushed the feature/ds210-update-typography-tokens branch from 5d9d148 to 494e556 Compare August 4, 2022 20:49
@garrettbear garrettbear linked an issue Aug 4, 2022 that may be closed by this pull request
@metamaskbot
Copy link
Collaborator

Builds ready [494e556]

@metamaskbot
Copy link
Collaborator

Builds ready [55e063e]

@metamaskbot
Copy link
Collaborator

Builds ready [3d07ef2]

@metamaskbot
Copy link
Collaborator

Builds ready [b895255]

@metamaskbot
Copy link
Collaborator

Builds ready [e97d739]

@metamaskbot
Copy link
Collaborator

Builds ready [cecc343]

@metamaskbot
Copy link
Collaborator

Builds ready [0f97561]

@garrettbear garrettbear force-pushed the feature/ds210-update-typography-tokens branch 2 times, most recently from 3768dad to 83ec5ec Compare August 8, 2022 16:50
@metamaskbot
Copy link
Collaborator

Builds ready [83ec5ec]

@metamaskbot
Copy link
Collaborator

Builds ready [e44aeb0]

@garrettbear garrettbear force-pushed the feature/ds210-update-typography-tokens branch from e44aeb0 to aa13648 Compare August 8, 2022 16:54
@metamaskbot
Copy link
Collaborator

Builds ready [aa13648]

@garrettbear
Copy link
Contributor Author

Comparison JS vs CSS Tokens

Small Screen JS

Screen Shot 2022-08-08 at 10 01 47 AM

Small Screen CSS

Screen Shot 2022-08-08 at 10 01 51 AM

Large Screen JS

Screen Shot 2022-08-08 at 10 01 55 AM

Large Screen CSS

Screen Shot 2022-08-08 at 10 01 59 AM

@metamaskbot
Copy link
Collaborator

Builds ready [9e11b9b]

Copy link
Collaborator

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

Looking good. Left some suggestions. I think s display MD should use bold for the font-weight. @SaraCheikh can confirm. Should we also add DEPRECATED to the CSS typography ramps just so it's clear?

Screen Shot 2022-08-08 at 12 06 34 PM

Screen Shot 2022-08-08 at 12 06 55 PM

@georgewrmarshall georgewrmarshall added the code Issue related to code work label Aug 8, 2022
@georgewrmarshall georgewrmarshall added the typography Tokens related to typography label Aug 8, 2022
@metamaskbot
Copy link
Collaborator

Builds ready [d47323e]

Replaced Heading-SM-Regular by Body-LG-Medium (#194)

* Replaced Heading-SM-Regular by Body-LG-Medium

* Replaced Heading-SM-Regular by Body-LG-Medium

* Adding BodyLGMedium to small screen and large screen

* Adding deprecated tags

Co-authored-by: georgewrmarshall <george.marshall@consensys.net>

DS210: Update large body text line height

DS-210: update font tokens, css based typeography stories, fix mobile sDisplayMD

DS-210: fix display font test

DS-210: use sans font token

Replaced Heading-SM-Regular by Body-LG-Medium (#194)

* Replaced Heading-SM-Regular by Body-LG-Medium

* Replaced Heading-SM-Regular by Body-LG-Medium

* Adding BodyLGMedium to small screen and large screen

* Adding deprecated tags

Co-authored-by: georgewrmarshall <george.marshall@consensys.net>

DS-210: Large screen font story fix

DS-210: fix small display md font weight

DS210: fix deprecated tags
@garrettbear garrettbear force-pushed the feature/ds210-update-typography-tokens branch from b5c9f63 to eacdb32 Compare August 8, 2022 22:51
@metamaskbot
Copy link
Collaborator

Builds ready [eacdb32]

@metamaskbot
Copy link
Collaborator

Builds ready [2a96d17]

@garrettbear
Copy link
Contributor Author

  • Fixed Small Display MD to use BOLD font weight now.
  • Fixed deprecated tag

Screen Shot 2022-08-08 at 3 53 40 PM

Copy link
Collaborator

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

LGTM! 🔥

@georgewrmarshall georgewrmarshall merged commit a44b411 into main Aug 9, 2022
@georgewrmarshall georgewrmarshall deleted the feature/ds210-update-typography-tokens branch August 9, 2022 19:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

code Issue related to code work typography Tokens related to typography

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Typography Line Height Tokens

5 participants