-
Notifications
You must be signed in to change notification settings - Fork 15
210: update typography line height tokens to be REM based #211
Conversation
georgewrmarshall
left a comment
There was a problem hiding this 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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚀
5d9d148
Builds ready [5d9d148]
|
There was a problem hiding this 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?
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>
</>
);
};5d9d148 to
494e556
Compare
Builds ready [494e556]
|
Builds ready [55e063e]
|
Builds ready [3d07ef2]
|
Builds ready [b895255]
|
Builds ready [e97d739]
|
Builds ready [cecc343]
|
Builds ready [0f97561]
|
3768dad to
83ec5ec
Compare
Builds ready [83ec5ec]
|
Builds ready [e44aeb0]
|
e44aeb0 to
aa13648
Compare
Builds ready [aa13648]
|
Builds ready [9e11b9b]
|
georgewrmarshall
left a comment
There was a problem hiding this 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?
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
b5c9f63 to
eacdb32
Compare
Builds ready [eacdb32]
|
Builds ready [2a96d17]
|
georgewrmarshall
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🔥









Switch REM based line height to match exactly with design