postcss-pxtorem icon indicating copy to clipboard operation
postcss-pxtorem copied to clipboard

"rootvalue" In the case of two designs, only one parameter can be set

Open declanchiu opened this issue 2 years ago • 1 comments

how to set the root value for a web project that has both mobile and PC designs? The mobile design has a size of 375px and the PC design has a size of 1920px. I would greatly appreciate any guidance on how to approach this, or if there is a function that can help with this issue. Thank you very much.

declanchiu avatar May 19 '23 09:05 declanchiu

I think in this situation, you can store your PC and mobile files in separate directories, and then perform the necessary checks in the rootValue function to return the corresponding values. The rootValue can be a function that takes parameters for performing the required checks.

Of course, you are not obligated to follow my suggestion exactly. As long as you can come up with conditions that satisfy the differentiation within the function, it should work. I hope this helps you.

slothvips avatar Jul 18 '23 08:07 slothvips