-
-
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
[material-ui] Convert Material UI components to support Pigment CSS #41273
Comments
Hey @siriwatknp on step 4 of Render demos, shouldn't it be |
@siriwatknp would like to work on |
I assigned the Breadcrumbs component to myself to work on them this week 👍🏼 It uses Typography though 🤔 const BreadcrumbsRoot = styled(Typography, {
name: 'MuiBreadcrumbs',
slot: 'Root',
overridesResolver: (props, styles) => {
return [{ [`& .${breadcrumbsClasses.li}`]: styles.li }, styles.root];
},
})({}); Is that a blocker given that the Typography component is on hold? |
@DiegoAndai the Breadcrumbs was taken by aacevski a while ago #41496 |
Assigned, thanks! |
😅 @siriwatknp is the Chip taken? If not, I can take it. |
Next up, I'd like to work on the Card component. |
Assigned.
Assigned. |
@siriwatknp which one can I take next? |
I'd like to take on BottomNavigation please. |
Assigned ButtonGroup to you. |
|
Please do, thanks! |
Hi @siriwatknp |
@siriwatknp I'll take the |
The Input needs a GlobalStyles (not done yet). Can you pick one from the "Ready-to-take Component". |
@siriwatknp I was wondering myself why the |
Thanks! We aim for May but it's not a fixed schedule. The faster we finish this issue, the faster we can do the stable release. |
@siriwatknp I'll work on the |
Thanks! assigned. |
@siriwatknp I would like to work on the |
@siriwatknp I've taken the liberty of converting the |
@siriwatknp I would like to work on the |
Hey, thanks for asking but the rest will be done by the codemod. Thank you so much! |
Left over components
CssBaseline
,ScopedCssBaseline
andPopper
#42640CssBaseline
,ScopedCssBaseline
andPopper
#42640CssBaseline
,ScopedCssBaseline
andPopper
#42640Thank you for past contributions
Contribution is welcome
The focus of Material UI v6 is to support static CSS extraction, and we are excited to invite the community to be a part of it!
For short context, the static extraction is done by our in-house styling-engine package, aka Pigment CSS. You can think of it as a replacement for Emotion/Styled-components. We must add an intermediate path to let the components support both Pigment CSS and Emotion.
The goal of this issue is to track the progress of the work with guidance on how to contribute and check the result. Explanation about Pigment CSS is out-of-scope. But you can visit the README for more info.
Contributing
Pick a component from the Ready-to-take section below. Tag @siriwatknp in the comment to assign to you (for example, if you take Accordion, Accordion* must be included in your PR).
Fork the repo (if you are a new contributor, please check the contributing first) and open the component implementation, e.g.
packages/mui-material/src/Avatar/Avatar.js
.Change the path import of these APIs,
styled
,useThemeProps
,keyframes
to../zero-styled
:💡 For
useThemeProps
, replace it withcreateUseThemeProps
and call the function with a string that has the same value asuseThemeProps({ props: inProps, name: <string> })
in the component implementation. Take a look at the Alert PR for example.Ensure that the
Component.propTypes
is followed by/* remove-proptypes */
directive.Check the component before attaching properties, e.g. in Divider:
Update styles implementation, see Converting styles below
Converting styles
Most of the time, you will have to convert styles interpolation to variants.
Move
ownerState
from the root style argument callback tovariants
Before:
After:
Use
Object.entries(theme.palette)
to populate colorsBefore:
After:
Example: https://github.com/mui/material-ui/pull/41230/files?diff=unified&w=0#diff-c2a97485bf897f10a4ae2116d86ea7d6eaed078be9781d4181b1a5bbf02ae170R60-R77
Render demos
pnpm install
oncenode scripts/pigmentcss-render-mui-demos.mjs react-alert
(replacereact-alert
with the component you are working on; thereact-*
must be one of https://mui.com/material-ui/*pnpm build
. (If you update the component again, you only need to build mui-material package withpnpm --filter @mui/material run build
)cd apps/pigment-css-next-app && pnpm dev
localhost:3000/material-ui/react-<component>
to check the resultOpen a PR
[material-ui][<Component>] Convert to support CSS extraction
Ready-to-take Components
CircularProgress
to support Pigment CSS #41776.muiName
attached)Will be done by a Codemod
#41743
#42001
.muiName
attached)useTheme()
).muiName
attached).muiName
attached) [material-ui][FilledInput] Convert to support CSS extraction #41663 @mj12albert.muiName
attached)useTheme()
)LinearProgress
to support Pigment CSS #41816useTheme
useTheme()
)useTheme()
)Waiting for 👍
extendSxProp
extendSxProp
BoxThe text was updated successfully, but these errors were encountered: