Skip to content

Conversation

@mnajdova
Copy link
Member

@mnajdova mnajdova commented Feb 21, 2024

Fixes #41220

Consolidate the arguments for the variants' props callback between the @mui/system and the zero-runtime. The argument is now merging props and ownerState, so that developers can do:

variants: [{
  props: (props) => props.someState === 'some-value'
}]

instead of needing to do:

variants: [{
  props: (props) => props.ownerState.someState === 'some-value'
}]

Zero-runtime related code: https://github.com/mui/material-ui/blob/master/packages/zero-runtime/src/styled.jsx#L9

@mnajdova mnajdova added the scope: system The system, the design tokens / styling foundations used across components. eg. @mui/system with MUI label Feb 21, 2024
@mui-bot
Copy link

mui-bot commented Feb 21, 2024

Netlify deploy preview

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

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 2adb748

Copy link
Contributor

@brijeshb42 brijeshb42 left a comment

Choose a reason for hiding this comment

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

Thanks

@mnajdova mnajdova marked this pull request as ready for review February 21, 2024 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: system The system, the design tokens / styling foundations used across components. eg. @mui/system with MUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[system][zero] Consolidate the arguments in the variant's props callback

3 participants