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

Top property is not converted to rem (stay in px) #7112

Closed
1 of 2 tasks
bastiengrignon opened this issue Nov 11, 2024 · 3 comments
Closed
1 of 2 tasks

Top property is not converted to rem (stay in px) #7112

bastiengrignon opened this issue Nov 11, 2024 · 3 comments
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)

Comments

@bastiengrignon
Copy link

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.13.5

What package has an issue?

@mantine/core

What framework do you use?

Vite

In which browsers you can reproduce the issue?

All

Describe the bug

There seems to be an issue with the top property, it is not converted to rem in CSS, other position property bottom, left, right) are converted to rem successfully but top is in px
You can see in the codesandbox by inspecting the Box element from Devtools

image

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

https://codesandbox.io/p/sandbox/mantine-react-template-forked-v38dwq?file=%2Fsrc%2FApp.tsx%3A14%2C1

Possible fix

No response

Self-service

  • I would be willing to implement a fix for this issue
@onkar-deshpande
Copy link
Contributor

onkar-deshpande commented Nov 13, 2024

It doesn't look like a bug. The code is written in such a way that for 0 value it uses rem for rest if no measurement type specified then it takes px as default type.

If this needs to be fixed then possible fix would be to modify condition check in style-props-data.ts file.

@bastiengrignon
Copy link
Author

I don't think the default behavior is px unit in Mantine library ! As mentionned in the docs here all units are converted into rem
And as you can see in the Codesanbox provided before and the screen uploaded for 0 values or a any random value the top property is not converted to rem compared to other properties like bottom

@rtivital rtivital added the Fixed patch Completed issues that will be published with next patch (1.0.X) label Nov 16, 2024
@rtivital
Copy link
Member

Fixed in 7.14.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

3 participants