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

[material-ui][joy-ui] Move typography CSS variables to font #42003

Merged
merged 7 commits into from Apr 24, 2024

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Apr 23, 2024

Regression from #41703

Changes related to typography in #41703 have been reverted. A new field, font, is created to store typography token.

usage:

<Box sx={{ font: 'h1' }} />

@siriwatknp siriwatknp added regression A bug, but worse customization: theme Centered around the theming features labels Apr 23, 2024
@mui-bot
Copy link

mui-bot commented Apr 23, 2024

Netlify deploy preview

https://deploy-preview-42003--material-ui.netlify.app/

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 2bf2437

@mnajdova
Copy link
Member

@siriwatknp should I wait for this to be merged before the release?

@danilo-leal danilo-leal added package: material-ui Specific to @mui/material package: joy-ui Specific to @mui/joy labels Apr 23, 2024
@danilo-leal danilo-leal mentioned this pull request Apr 23, 2024
1 task
@siriwatknp
Copy link
Member Author

@siriwatknp should I wait for this to be merged before the release?

Yes, I think this should be included.

@siriwatknp
Copy link
Member Author

@danilo-leal Could you take a look at this PR again?

Copy link
Contributor

@danilo-leal danilo-leal left a comment

Choose a reason for hiding this comment

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

Looks good — I don't see any of the regressions on the deploy preview! However, it might be worth clarifying how this new font field solves/helps with that regression. Or even the benefit of using it, which isn't immediately clear to me.

@siriwatknp
Copy link
Member Author

siriwatknp commented Apr 24, 2024

Looks good — I don't see any of the regressions on the deploy preview! However, it might be worth clarifying how this new font field solves/helps with that regression. Or even the benefit of using it, which isn't immediately clear to me.

Sure, this effort is a part of lifting the theme to CSS variables. It's useful for applications that are not limited to Material UI or React because they can access the theme using CSS.

For example, using a plain CSS file to style a part of an application using the generated CSS variable from Material UI theme:

// custom.css
.foo {
  font: var(--mui-font-h1);
}

Or with Tailwind:

<div class="[font:--mui-font-h1]" />

Will add these improvements to the docs.

@siriwatknp siriwatknp enabled auto-merge (squash) April 24, 2024 03:21
@siriwatknp siriwatknp merged commit fc8fd64 into mui:next Apr 24, 2024
19 checks passed
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customization: theme Centered around the theming features package: joy-ui Specific to @mui/joy package: material-ui Specific to @mui/material regression A bug, but worse
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants