mantinedev / ui.mantine.dev

Mantine UI website and components
https://ui.mantine.dev
MIT License
2.84k stars 314 forks source link

Is there any special meaning to using the rem function as in this sample code? #76

Open eastack opened 10 months ago

eastack commented 10 months ago

After looking at the documentation, this function seems similar to the remainder operator (%) in JS, but here it only provides one parameter. So why don't we just write the corresponding value directly instead of using the rem function? Is there some other reason for it?

https://ui.mantine.dev/component/header-search/

image

rtivital commented 10 months ago

https://mantine.dev/styles/postcss-preset/#remem-functions

eastack commented 10 months ago

Thank you so much for your help! I really appreciate you taking the time to help me with this. As a newbie, I don't have a good understanding of frontend engineering systems. But a question comes to my mind - if I want to use the original rem function in CSS, will it conflict with this feature (or can it be automatically distinguished by checking the number of arguments during preprocessing)?