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

Mantine Library ClassNames conflicts with UnoCSS and TailWind "Margin" rule #5968

Closed
1 of 2 tasks
ziongh opened this issue Mar 22, 2024 · 1 comment
Closed
1 of 2 tasks
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)

Comments

@ziongh
Copy link

ziongh commented Mar 22, 2024

Dependencies check up

  • I have verified that I use latest version of all @mantine/* packages

What version of @mantine/* packages do you have in package.json?

7.6.2

What package has an issue?

@mantine/core

What framework do you use?

create-react-app (CRA)

In which browsers you can reproduce the issue?

All

Describe the bug

When using Mantine alongside UnoCss sometimes (it is quite random, because of the nonce generator) it happens that the nonce generator outputs a string that is only numbers. And that is used to generate a classname on the format:

m-[nonce]

However, the tailwind and UnoCss use this prefix to indicate "margin" (e.g.: m-5 would represent margin-left: 1rem;)

And when the nonce is only numbers, the postcss processor of UnoCss generates the relative margin class. For example m-8983817 woudl output margin: 2245954.25rem;

And reading the docs it explicitly defines that this prefix cannot be changed: https://mantine.dev/theming/mantine-provider/#classnamesprefix

If possible, include a link to a codesandbox with a minimal reproduction

No response

Possible fix

  • Allow for custom prefix
  • Allow for custom nonce on the component classes

Self-service

  • I would be willing to implement a fix for this issue
rtivital added a commit that referenced this issue Mar 26, 2024
@rtivital rtivital added the Fixed patch Completed issues that will be published with next patch (1.0.X) label Mar 26, 2024
@rtivital
Copy link
Member

Fixed in 7.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)
Projects
None yet
Development

No branches or pull requests

2 participants