Skip to content
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

[fix] Implement variant matching parity #111

Merged
merged 1 commit into from
May 29, 2024

Conversation

DiegoAndai
Copy link
Member

Follow up on mui/material-ui#42358 (review)

Merge props and ownerState the same way it's done in MUI System's createStyled

cc: @mnajdova

@DiegoAndai DiegoAndai added the bug 🐛 Something doesn't work label May 28, 2024
@DiegoAndai DiegoAndai self-assigned this May 28, 2024
@DiegoAndai DiegoAndai changed the title Implement variant matching parity [fix] Implement variant matching parity May 28, 2024
@DiegoAndai
Copy link
Member Author

Before and after

Textfield demos with 0.0.10:

Screen.Recording.2024-05-28.at.12.31.48.mov

Textfield demos with this PR's build:

Screen.Recording.2024-05-28.at.12.30.31.mov

@brijeshb42 when running the demos with this PR's build, the following code on one of the demos errored:

function RedBar() {
  return (
    <Box
      sx={{
        height: 20,
        backgroundColor: (theme) =>
          theme.palette.mode === 'light'
            ? 'rgba(255, 0, 0, 0.1)'
            : 'rgb(255 132 132 / 25%)',
      }}
    />
  );
}

With:

theme is not defined

This didn't happen when running with 0.0.10. Why might this be? I would expect it to fail on both versions, specially as this change is not related to the sx prop or theme handling.

@brijeshb42
Copy link
Contributor

brijeshb42 commented May 28, 2024

I'll have to check. There was a change by @siriwatknp where he changed the callback argument from being ({theme}) => to (theme) => to be same as system. This might be the reason.

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.

@brijeshb42 brijeshb42 merged commit e4bb1a2 into mui:master May 29, 2024
12 checks passed
@DiegoAndai DiegoAndai deleted the owner-state-resolution-parity branch May 29, 2024 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants