-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[joy] Refine the default theme #36843
Conversation
Netlify deploy preview
@mui/joy: parsed: -0.99% 😍, gzip: +0.27% Bundle size reportDetails of bundle changes (Toolpad) |
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.
@danilo-leal I started by removing some font-size, font-weight and levels that are not likely to be used to keep the theme as lean as possible.
For font-size, I think if it is lower than 12px
it is very hard to read so I don't think < xs
should be in the default theme.
For h5 and h6, I follow tailwindcss typography:
But now we have. Please don't use h5 or h6 in your content, Medium only supports two heading levels for a reason, you animals. I honestly considered using a before pseudo-element to scream at you if you use an h5 or h6.
sm: '0.875rem', // 14px | ||
md: '1rem', //16px | ||
lg: '1.25rem', // 20px | ||
xl:'1.5rem', // 24px |
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.
I've reduced the amount of typography, but didn't delete the remain font sizes, should we do it?
md: '12px', | ||
lg: '16px', | ||
xl: '20px', | ||
xs: '2px', |
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.
I've reduced a bit the radius, but it's not set in stone, what do you think?
Sorry @siriwatknp, I got carried away and ended up committing all the changes at once 😅 Besides the comments I left in the file, I'd like to ask a few more things:
|
Would it be possible to have a token for it? I think opacity could be a bit tricky to contrast when dealing with so many variables.
I'm not sure if it'd be in |
What do you think about adding the token to |
I was testing the contrast here and probably we would have to have one for each variant (plain, solid,soft and outlined). What do you think we could do then? |
Opportunities for improvement:
|
I was looking at the components at |
@siriwatknp I've updated the typography according to what we discussed on the Figma file. Also, I was making some tests at |
@siriwatknp I tweaked the shadows, surfaces, some icon colors, and the disabled button. Also, I updated the email template to remove the custom styles to make it closer to the default as possible. |
@zanivan I adjust the global variant tokens a bit (disabled and some neutral palette tokens). I think the before version is too light and too close to the disabled state, so I increase the contrast a little bit more and also make the disabled state lighter. Let me know what you think! |
@td5999 I plan to merge it this week and it will be released next week with |
These changes are great. It's exciting that Joy is moving to beta! |
I generally like the changes, I do prefer the old grey scale tho, so definitly going to restore that in the implementations we use (or at least the blue shine in it). :) Anyways great work! |
Thanks for the feedback! in that case you can take a look at this migration doc on how to use the previous neutral and primary colors. |
@mwskwong Thanks for the feedback!
I feel like the icon color should be lighter than the text to be complementary. That's why I choose Some inspiration: No worry if you want to change it, you can override it via the theme: extendTheme({
colorSchemes: {
light: {
palette: {
text: {
icon: 'var(--joy-palette-neutral-600)',
}
}
},
dark: { … },
}
})
I think @zanivan has fixed it in the latest commit.
Yes, the previous version does not have much contrast between texts. I feel like the new version looks a lot better. Anyway, you can override the theme level as you like: extendTheme({
typography: {
'body-md': {
color: 'var(--joy-palette-text-primary)',
},
…
}
}) |
I didn't have the time to dive into this PR, instead I put together all the opportunities that I could spot in the latest release at https://www.notion.so/mui-org/Olivier-design-review-on-Joy-Design-3ada9a7bcfa44b9fab1fe5032dfb33bb and public link. Overall, I love that we are allocating time to shape the look & feel, I think it's a high ROI effort 👍 |
@clarkmcc Hey! Feel free to open an issue in case we can help with any issues due to recent Joy UI updates ⎯ anyhow, it's super cool you're using it; appreciate you giving it a shot! In this case, although it definitely doesn't look nice, it's not technically broken. That's due to Joy UI's global variants feature, which allows all components to have the same variant set, and their styles to be defined in one place only. It's conceptually a sweet feature and, overall, works fine. But, there are many cases, such as this Card one, where certain variants simply don't make sense (or even look broken, as you pointed out). The tentative solution we're flirting with is "turning off" non-sensical variants for specific components, which still allows us to keep the benefits of globally defined variant styles. There are also other options in the table and it's generally something we want to sort through before the stable version ⎯ so, keep an eye out! |
closes #35788
closes #37663
closes #36782
closes #37663
closes #37967
closes #38165
Migration docs: https://deploy-preview-36843--material-ui.netlify.app/joy-ui/migration/migrating-default-theme/
New Tabs design: https://deploy-preview-36843--material-ui.netlify.app/joy-ui/react-tabs/
Migration tested: https://codesandbox.io/s/joy-cra-ts-forked-mtdp6g?file=/src/App.tsx
Try it out
We really appreciate it if you could try the new changes in your existing Joy UI project.
Replace the
@mui/joy
version in your package.json with this:run
yarn install
(you might have to run it twice because the first time might see an error).Follow the migration docs
Review recommendation
Better to go through the migration docs because it is the source of all breaking changes.
Changes
Tokens removed
palette.info
letterSpacing
Typography
The composition of
title-*
andbody-*
is improved. When using them together with an icon, there is no need to add extra margin at all. For example:Templates