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

[base-ui] Change the Mui- class prefix #39467

Closed
michaldudak opened this issue Oct 16, 2023 · 3 comments · Fixed by #40205
Closed

[base-ui] Change the Mui- class prefix #39467

michaldudak opened this issue Oct 16, 2023 · 3 comments · Fixed by #40205
Assignees
Labels
breaking change enhancement This is not a bug, nor a new feature package: base-ui Specific to @mui/base

Comments

@michaldudak
Copy link
Member

michaldudak commented Oct 16, 2023

To allow Base UI components to be styled with plain CSS and coexist with Material UI components in the same projects, we need to be able to differentiate between them.

According to #33260 (comment), the preferred solution was to add a product-specific class name to Base UI components (such as Mui-Base), so , for example, the resulting classes on a disabled button would be Mui-Base MuiButton-root Mui-disabled.

However, as we're considering decoupling Base UI from the MUI umbrella, we can also reconsider the class name pattern (especially that {productName}{componentName} was voted for only slightly less than the winning option).

@michaldudak michaldudak converted this from a draft issue Oct 16, 2023
@github-actions github-actions bot added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 16, 2023
@michaldudak michaldudak changed the title [base-ui] Change the mui- class prefix [base-ui] Change the Mui- class prefix Oct 16, 2023
@michaldudak michaldudak added this to the Base UI: Stable release milestone Oct 16, 2023
@michaldudak michaldudak moved this from Backlog to Selected in Joy UI Oct 16, 2023
@zannager zannager added the package: base-ui Specific to @mui/base label Oct 16, 2023
@michaldudak michaldudak moved this to Selected in Base UI Oct 25, 2023
@michaldudak michaldudak added enhancement This is not a bug, nor a new feature and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 2, 2023
@michaldudak michaldudak moved this from Selected to In progress in Base UI Nov 7, 2023
@github-project-automation github-project-automation bot moved this from In progress to Done in Base UI Jan 15, 2024
@github-project-automation github-project-automation bot moved this from Selected to Recently completed in Joy UI Jan 15, 2024
@oliviertassinari
Copy link
Member

oliviertassinari commented Feb 15, 2024

I'm reopening to keep track of #40205 (comment). I think that each breaking change is important, and deserves to be covered in depth on why of each change (helps build trust with developers).

What's the plan for Material UI class names, change them to .mui-Button-root? If we don't plan to change it,
.BaseButton-root looks like a clear direction to take. It's arbitrary, so we might as well be consistent before we make it stable.

Effectively, I don't understand:

  • why base-Button-root and not BaseButton-root. Why should we teach developers two different conventions?
  • why base--focused and not Base--focused (assuming Mui-focused will progressively go away, because we will mostly use Base--focused in Material UI/Joy UI/MUI X, so we can solve the similarity problem between pseudo states class names and slot class names by using -- and not -)

Side thought 1.

The change to remove the Mui prefix makes sense to me in the strategy to teach developers and make them aware of what they are working with. For instance, if a developer relies a lot on the class names to know which component you can override in the theme (how I would use it), then Base UI using Mui in the class names is horrible DX.


Side thought 2.

A quick benchmark:

I wonder if we even need class names on slots (we need pseudo-states) Isn't this annoying for a developer who wants to work headless? There are no class names on a <select> (though you can use a select selector, so not a fair comparison). I get the value when relying on slots, it's a pain to add class names, but if we are moving to have the DOM node to be user-facing, then it's easy?

@github-project-automation github-project-automation bot moved this from Done to In progress in Base UI Feb 15, 2024
@michaldudak
Copy link
Member Author

@danilo-leal danilo-leal removed this from Joy UI Feb 16, 2024
@michaldudak
Copy link
Member Author

Closing the issue as Base UI does not use classes anymore.

@michaldudak michaldudak closed this as not planned Won't fix, can't repro, duplicate, stale Nov 7, 2024
@michaldudak michaldudak removed this from Base UI Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change enhancement This is not a bug, nor a new feature package: base-ui Specific to @mui/base
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants