-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Migrate all components to emotion #24405
Comments
Gunna take a shot at |
TypeScript, unless there is a good reason not too. |
Looks like we finished the migration of all core components 🥳 We have around 2/3 left in the lab and we will be done with those too ✔️ Thanks a lot to everyone that contributed 🙏 |
@mnajdova are the pickers ready to be picked up? |
This sounds like a question for @eps1lon. Without the context, I would assume the answer is yes (so we only bundle one CSS-in-JS engine) unless there is a planned change that could happen before, making the migration to emotion more efficient? |
Pickers should be good to go. |
For some unknown reason, some The files are:
|
@vicasas they were moved to the |
I have one query. I was reading v5 beta documentation and was looking at some code. As MUI migrating to emotion. In documentation are you going to use backticks or object method for styling? const Main = styled('main', { shouldForwardProp: (prop) => prop !== 'open' })(
({ theme, open }) => ({
flexGrow: 1,
padding: theme.spacing(3),
transition: theme.transitions.create('margin', {
easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.leavingScreen,
}),
marginLeft: `-${drawerWidth}px`,
...(open && {
transition: theme.transitions.create('margin', {
easing: theme.transitions.easing.easeOut,
duration: theme.transitions.duration.enteringScreen,
}),
marginLeft: 0,
}),
}),
); |
@anurodhmohapatra We use the JavaScript object syntax to one exception. We use the CSS template for the customization demos with the unstyled components. |
And correct me if I am wrong but when there are key frames involved? Such as circular progress? |
@oliviertassinari This means we will be getting JavaScript object syntax out of the box which we can modify to customise it. If there is any element which is unstyled we will use tagged template literals(backticks) for styling. Am I right? Or is there any other best practice? |
Well done everybody in the migration! 👏 |
As decided in #22342 we need to migrate all the components to the
@mateiral-ui/styled-engine
(emotion by default) API. We've already converted a dozen components. We are now confident with the approach. We have fixed most of the challenges it creates. This issue will help track the progress of the migration.For converting a component, you can use as a template any of the already converted components, e.g #24397. We have also this migration guide in case you want to prepare yourself before starting, or in case if something is not working as expected.
This is a useful checklist to have when migrating a component:
General checklist:
sx
prop typesclasses
&describeConformanceV5
usage)index.js
&index.d.ts
Component checklist:
useThemeProps
,useUtilityClasses
are used and correct (styleProps
need to be created)styled()
components (exampleButtonLabel
)styleProps
andclasses
are spread on root and all slots correctlyas={component}
on the Root slot& .${componentClasses.slot}
]Here is a list of all components with their status:
Note: if you see that the components depends on some other components, then those components need to be converted first, before the component itself can be migrated.
@material-ui/core
ListSubheader
,Chip
[Autocomplete] Migrate to emotion #24696SwitchBase
[Checkbox] Migrate to emotion #24702ClickAwayListenerNO_NEED_FOR_CONVERSIONModal
[Drawer] Migrate to emotion #25091FadeNO_NEED_FOR_CONVERSIONInputBase
[TextField] Migrate FilledInput to emotion #24634GrowNO_NEED_FOR_CONVERSIONInputBase
[TextField] Migrate Input component to emotion #24638FormLabel
[TextField] Migrate FormLabel and InputLabel to emotion #24665MenuList
[Menu] Migrate to emotion #25264ListItem
[Menu] Migrate MenuItem to emotion #24631MenuListNO_NEED_FOR_CONVERSIONInput
[Select] Migrate NativeSelect to emotion #24698NoSsrNO_NEED_FOR_CONVERSIONInputBase
[TextField] Migrate OutlinedInput to emotion #24688PaginationItem
[Pagination] Migrate Pagination and PaginationItem to emotion #25146PopperNO_NEED_FOR_CONVERSIONPortalNO_NEED_FOR_CONVERSIONNO_NEED_FOR_CONVERSIONInput
,NativeSelectInput
,FilledInput
,OutlinedInput
[Select] Migrate to emotion #25653SlideNO_NEED_FOR_CONVERSIONSnackbarContent
[Snackbar] Migrate to emotion #25142Fab
[SpeedDial] Migrate to emotion #25166Tooltip
,Fab
[SpeedDial] Migrate to emotion #25166StepLabel
[Stepper] Migrate StepButton to emotion #25516SwipeableDrawerNO_NEED_FOR_CONVERSIONSwitchBase
[Switch] Migrate to emotion #24693Select
,Menuitem
[Table] Migrate TablePagination to emotion #25809TextareaAutosizeNO_NEED_FOR_CONVERSIONZoomNO_NEED_FOR_CONVERSION@material-ui/lab
Unstable_TrapFocusNO_NEED_FOR_CONVERSIONOnce the migration of the core components is done, we can then migrate all the demos of the documentation to the
sx
prop (preferred) andstyled
API, removing all imports ofwithStyles
andmakeStyles
.Current progress 169/169
The text was updated successfully, but these errors were encountered: