-
-
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
[mui-codemod][AccordionSummary] Add contentGutters deprecation codemods #41006
Conversation
Netlify deploy previewBundle size report |
144561a
to
75f5ff3
Compare
Signed-off-by: Diego Andai <diego@mui.com>
Signed-off-by: Diego Andai <diego@mui.com>
Signed-off-by: Diego Andai <diego@mui.com>
docs/data/material/migration/migrating-from-deprecated-apis/migrating-from-deprecated-apis.md
Outdated
Show resolved
Hide resolved
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.
Please see my comments about the styleOverrides
and overridesResolver
. The rest looks good 👍
Thanks for the review @siriwatknp! I implemented the fixes Also, I reduced the scope of the codemods to only pickup the |
Agree! |
docs/data/material/migration/migrating-from-deprecated-apis/migrating-from-deprecated-apis.md
Show resolved
Hide resolved
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.
👍
Part of: #40417
Summary
This PR adds codemods for the AccordionSummary's
contentGutters
composed class deprecation. It covers the customization use cases on our docs (https://mui.com/material-ui/customization/how-to-customize/): thesx
prop, the theme, thestyled
function, and plain CSS.CSS transform support
Previously, we only had JS transforms. This PR adds support for CSS transforms using
postcss
andpostcss-cli
. It was necessary to usepostcss
in an unusual (but supported) way to keep the same codemod CLI API. The way it works is:<codemod>/postcss-plugin.js
file that implements and exports the postcss plugin<codemod>/postcss.config.js
file that imports the plugin and exports the config with only that plugin. This is the only way I could find to load local plugins.deprecations/all
, we have a separatepostcss.config.js
that imports all the plugins (which is only one for now)If the user runs a specific codemod, then
<codemod>/postcss.config.js
is used so only that codemod's plugin is applied. If the users runs thedeprecations/all
codemod, thendeprecations/all/postcss.config.js
is used so all codemod plugins are applied.Other styling options
In theory, we could leverage
postcss
to support other style approaches, like Sass or Less. This could be done via the codemod's CLI. This PR doesn't implement this, but we can do if the community asks for it.Child class
The
contentGutters
class is applied to the content child, not theAccordionSummary
root. Thecontent
class is also applied to the content child, but thegutters
class is applied to the root. Because of this, we only covercontentGutters
used with a child selector (.contentGutters
). Thegutters
class is applied without the child selector, and thecontent
class keeps the child selector:.gutters .content
.