Skip to content

[base] Change the order of class names merged in useSlotProps - #33383

Merged
michaldudak merged 3 commits into
mui:masterfrom
michaldudak:classname-order
Jul 5, 2022
Merged

[base] Change the order of class names merged in useSlotProps#33383
michaldudak merged 3 commits into
mui:masterfrom
michaldudak:classname-order

Conversation

@michaldudak

Copy link
Copy Markdown
Member

This PR sets the order of classes returned from useSlotProps to be internal-first, external-last. This was discussed in #33205 (comment)

cc @garronej

@michaldudak michaldudak added internal Behind-the-scenes enhancement. Formerly called “core”. package: @mui/base Specific to @mui/base (legacy). labels Jul 4, 2022
@michaldudak
michaldudak requested a review from mnajdova July 4, 2022 07:23
@garronej

garronej commented Jul 4, 2022

Copy link
Copy Markdown
Contributor

Great!!!

@mui-bot

mui-bot commented Jul 4, 2022

Copy link
Copy Markdown

Details of bundle changes

Generated by 🚫 dangerJS against 3fd96ea

@mnajdova mnajdova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great. Please add a comment in mergeSlotProps above the joinedClasses declaration a comment explaining why this order is important, so that we can have a context in the future if we need to add more thing there.

@michaldudak

Copy link
Copy Markdown
Member Author

Done.

I just hope we won't see another popular styling library require the opposite order to work correctly. MUI Base is supposed to work with any styling solution and I'm not very happy about such a leaky abstraction.

@michaldudak
michaldudak merged commit 5d65b4f into mui:master Jul 5, 2022
@michaldudak
michaldudak deleted the classname-order branch July 5, 2022 11:36
@garronej

garronej commented Jul 5, 2022

Copy link
Copy Markdown
Contributor

Hi @michaldudak,
Thank you that's great news.

daniel-rabe pushed a commit to daniel-rabe/material-ui that referenced this pull request Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Behind-the-scenes enhancement. Formerly called “core”. package: @mui/base Specific to @mui/base (legacy).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants