Skip to content
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

[system] Improve the fontWeight property by improving the values used #23192

Closed
1 task done
mnajdova opened this issue Oct 21, 2020 · 1 comment · Fixed by #23635
Closed
1 task done

[system] Improve the fontWeight property by improving the values used #23192

mnajdova opened this issue Oct 21, 2020 · 1 comment · Fixed by #23635
Labels
discussion new feature New feature or request package: system Specific to @mui/system

Comments

@mnajdova
Copy link
Member

mnajdova commented Oct 21, 2020

  • I have searched the issues of this repository and believe that this is not a duplicate.

Summary 💡

This is a proposal of how we may improve the fontWeight prop in the system.

This is how it looks currently:

<Box
  fontWeight="fontWeightRegular"
/>

Option 1

The first option of how we may improve it is by the following usage:

<Box
  fontWeight="regular"
/>

where we would pull values from theme.typography.fontWeightX Related to #17615

Option 2

The other option is to use the following:

<Box
  fontWeight="body1.fontWeight"
/>

where we would be still pulling from theme.typography.x.

First reported in #23053 (comment)

I am in favor of the second approach, but I am open for opinion from others :)

@mnajdova mnajdova added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 21, 2020
@mnajdova mnajdova mentioned this issue Oct 21, 2020
2 tasks
@mnajdova mnajdova added package: system Specific to @mui/system new feature New feature or request discussion and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 21, 2020
@oliviertassinari
Copy link
Member

Option 2. is already supported, I think that option 1 and 2 are complementary and will be welcomed.

A proposal, we can make it systematic for the other typography values. We could have:

  • x: 'default' pulls from theme.typography.x
  • x: 'y' pulls from theme.typography.xY or theme.typography.y.

This would solve #17615 from @lcswillems but also simplify

<Box fontFamily="fontFamily" />

to

<Box fontFamily="default" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion new feature New feature or request package: system Specific to @mui/system
Projects
None yet
2 participants