[QUESTION] - Scale rem size based on screen height/width #162
-
|
Hello I’m a FE engineer at STRV, and in our projects we typically use a scale function to scale all size values, for example: Basically, all size-related values in our project go through ms or s functions. We use this approach to maintain a consistent UI across different screen sizes. My question is: how can we implement similar functionality with Uniwind? I’ve looked into the following:
Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
You could create some kind of scale CSS variable --scale-v: calc(100vw / 500);And then use it to create classes But I don't think that it is a good idea for maintaince and dx. We're just using tailwindcss so if you're able to find a better solution for your problem in tailwind you can try using it with uniwind. Maybe just updating the --spacing will be enough for most cases |
Beta Was this translation helpful? Give feedback.
-
|
It’s tricky for me - right now I’m starting a new project and setting up all the technologies for it, and I genuinely would love to use Uniwind on this project 🙈 But I’m worried that the absence of this feature (or not knowing the best way to solve it with Uniwind) might cause issues in the future, which is why, at this moment, I’m leaning toward not using it in my project 😕 I still have a couple of days to decide, so if you have a time, guys - it would be great to hear your opinions on this issue @Brentlok @needim @jpudysz. Thank you |
Beta Was this translation helpful? Give feedback.
I've never used such approach when developing apps across multiple screen sizes. I generally just stick to using breakpoints so for example I can set flex-direction to column on smaller screens and row on larger ones. If for your app you must use this scaling approach I would go for unistyles because it offers styling similar to StyleSheet with a much more features