-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
[material-next] Update Material You typescale tokens #39514
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,84 +3,119 @@ const mdSysTypescale = { | |
small: { | ||
family: 'Roboto', | ||
weight: '500', | ||
lineHeight: 16, | ||
size: 11, | ||
tracking: 0.5, | ||
lineHeight: 16, | ||
}, | ||
medium: { | ||
family: 'Roboto', | ||
weight: '500', | ||
lineHeight: 16, | ||
// TODO: label.medium has an alternative font weight https://m3.material.io/styles/typography/type-scale-tokens | ||
// md.sys.typescale.label-medium.weight.prominent -> md.sys.typescale.label-medium.weight.prominent -> '700' | ||
size: 12, | ||
tracking: 0.5, | ||
lineHeight: 16, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It can be misleading for people using the theme to divide this value with the size to get the specific CSS line height value. What I mean is that this will be used in most cases like:
Should we specify in the name that it is a px value? If it was up to me I would define two values There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will let @DiegoAndai decide. It may be useful to have a design perspective, cc @danilo-leal There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This makes perfect sense to me. I think it will avoid confusion as users would expect the Also, adding the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mnajdova @DiegoAndai Good idea ~ I've added a task in #38804 (let's make this change separately) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sounds good too. My point was, if we plan to rename it, why do a breaking change for just one release, but it's experimental package so it should be fine, it shouldn't affect lots of people. |
||
}, | ||
large: { | ||
family: 'Roboto', | ||
weight: '500', | ||
lineHeight: 20, | ||
// TODO: label.large has an alternative font weight https://m3.material.io/styles/typography/type-scale-tokens | ||
// md.sys.typescale.label-large.weight.prominent -> md.sys.typescale.label-large.weight.prominent -> '700' | ||
size: 14, | ||
tracking: 0.1, | ||
lineHeight: 20, | ||
}, | ||
}, | ||
body: { | ||
small: { | ||
family: 'Roboto', | ||
weight: '400', | ||
size: 12, | ||
tracking: 0.4, | ||
lineHeight: 16, | ||
}, | ||
medium: { | ||
family: 'Roboto', | ||
weight: '400', | ||
size: 14, | ||
tracking: 0.25, | ||
lineHeight: 20, | ||
}, | ||
large: { | ||
family: 'Roboto', | ||
weight: '400', | ||
tracking: 0.15, | ||
size: 16, | ||
tracking: 0.5, | ||
lineHeight: 24, | ||
}, | ||
}, | ||
title: { | ||
small: { | ||
family: 'Roboto', | ||
weight: '500', | ||
size: 14, | ||
tracking: 0.1, | ||
lineHeight: 20, | ||
}, | ||
medium: { | ||
family: 'Roboto', | ||
weight: '500', | ||
size: 16, | ||
tracking: 0.15, | ||
lineHeight: 24, | ||
}, | ||
large: { | ||
family: 'Roboto', | ||
weight: '400', | ||
size: 22, | ||
tracking: 0, | ||
lineHeight: 28, | ||
}, | ||
}, | ||
headline: { | ||
small: { | ||
family: 'Roboto', | ||
weight: '400', | ||
size: 24, | ||
tracking: 0, | ||
lineHeight: 32, | ||
}, | ||
medium: { | ||
family: 'Roboto', | ||
weight: '400', | ||
size: 28, | ||
tracking: 0, | ||
lineHeight: 36, | ||
}, | ||
large: { | ||
family: 'Roboto', | ||
weight: '400', | ||
size: 32, | ||
tracking: 0, | ||
lineHeight: 40, | ||
}, | ||
}, | ||
display: { | ||
small: { | ||
family: 'Roboto', | ||
weight: '400', | ||
size: 36, | ||
tracking: 0, | ||
lineHeight: 44, | ||
}, | ||
medium: { | ||
family: 'Roboto', | ||
weight: '400', | ||
size: 45, | ||
tracking: 0, | ||
lineHeight: 52, | ||
}, | ||
large: { | ||
family: 'Roboto', | ||
weight: '400', | ||
size: 57, | ||
tracking: -0.25, | ||
lineHeight: 64, | ||
}, | ||
}, | ||
}; | ||
|
Uh oh!
There was an error while loading. Please reload this page.
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.
Not sure if it's better to have a
weightProminent
property or add alabel.mediumProminent
variant but we can worry about it later, referencing material-web.dev this is very rarely used: https://github.com/search?q=repo%3Amaterial-components%2Fmaterial-web%20prominent&type=codeThere 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.
I think adding
weightProminent
is more in line with how material names their tokens.I agree