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

[core] Add unstable_ClassNameGenerator API #29051

Merged
merged 6 commits into from Oct 19, 2021

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Oct 14, 2021

close #28550

As mentioned in #28550 (comment). All of the global class name is generated from generateUtilityClass, so providing some global object to manipulate class name generation sounds like a good solution (since the class name does not need run-time changing).


  • Fix hard-coded classname to use *Classes
    • Autocomplete
    • DialogContent
    • AvatarGroup

@mui-pr-bot
Copy link

mui-pr-bot commented Oct 14, 2021

Details of bundle changes

Generated by 🚫 dangerJS against b309859

@siriwatknp siriwatknp added the on hold There is a blocker, we need to wait label Oct 15, 2021
@siriwatknp siriwatknp marked this pull request as ready for review October 15, 2021 10:11
Co-authored-by: Benny Joo <sldisek783@gmail.com>
Co-authored-by: Marija Najdova <mnajdova@gmail.com>
Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Looks great! 👍

@siriwatknp siriwatknp merged commit 2589f6f into mui:master Oct 19, 2021
@oliviertassinari oliviertassinari changed the title [core] add unstable_ClassNameGenerator API [core] Add unstable_ClassNameGenerator API Nov 1, 2021
@oliviertassinari oliviertassinari removed the on hold There is a blocker, we need to wait label Nov 1, 2021
Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

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

Are we sure it fixes the problem of @smora-gh? They seem to need multiple prefixes on the same page. The PR uses a global singleton, it will be unique for the whole page.

IMHO, the only real use case for a class name generator is white labeling. People that build a design system and don't want to see MUI mentioned in the DOM. I fail to envision other use cases.

```diff
+import { outlinedInputClasses } from '@mui/material/OutlinedInput';

const theme = createTheme({
Copy link
Member

Choose a reason for hiding this comment

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

A general rule, there is always blank space in place of the + or - in the git diff

   const theme = createTheme({

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: base-ui Specific to @mui/base
Projects
None yet
Development

Successfully merging this pull request may close these issues.

createGenerateClassName
5 participants