DEV Community

Discussion on: Convert px to rem Using Sass - 3 methods

Collapse
 
itpretty profile image
itpretty

Many thanks for the inspiring methods :)

Wonder if would be possible to make the 16 in $remValue: ($value / 16) + rem; dynamic, say some var --baseline defined at :root? The scenario is 16 can change based on @media query of CSS.

Regards :)
Riting

Collapse
 
esneyder110 profile image
Esneyder110

Hey, i have the same question.
What happen if the 1rem is equal to 32px?
That value depends on the user's browser settings.

In that cases the function don't work properly