DP aware breakpoints/media queries for Mobile Devices #395
kasvith
started this conversation in
Feature Requests
Replies: 1 comment 9 replies
-
Hey @kasvith we will discuss it internally and back to you |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Team,
This is a problem i came across while using uniStyles with various mobile device sizes.
In RN we uses DP to measure units, this is totally different from Web as in Web the pixel sizes and everything is handled by browsers
But if we consider a Native mobile app things are really difficult to handle as some devices(apple) has DPR values going upto 3.0
So in uniStyles if we want to look for a smaller mobile screen like iPhoneSE
Viewport Size: 320px × 568px
Screen Size: 640px × 1136px
Device Pixel Ratio: DPR 2
the width returned by uniStyles is 640 for iPhoneSE, but actually the screen size is 320
So the breakpoints, media queries we define doesnt work really well since uniStyle doesnt seems care about the DPR and returning the screen size(View Port Size x DPR)
this is a really difficult situation as in web it works(our breakpoints are in Pixels like in tailwind/bootstrap but they hold true to the view port size instead of true pixel count in web), but in RN we should also consider the DPR to get sizes
So i belive uniStyles should either handle this internally or provide utilities to handle it
from developer's perspective i dont care about the DPR(as how it should be with RN)
Beta Was this translation helpful? Give feedback.
All reactions