nirsky / react-native-size-matters

A lightweight, zero-dependencies, React-Native utility belt for scaling the size of your apps UI across different sized devices.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I made react-native-size-matters for IPhoneX and XS

tomo25 opened this issue · comments

commented

Hi @nirsky ,

I'm a developer building a mobile app using react native. I've been using react-native-size-matters to change the size of each content according to the user's devices. It's great but there's one problem. react-native-size-matters is supporting screen ~5 as a standard but our designer is making our app using IPhoneXS.This means that each contents size will be a little different from what we expect. For example, when our designer made a button with width:100, we implement it as width: '100@s' using react-native-size-matters. But when we open up the app, the width will be 100*375/350(because iphoneX's width is 375 and the default is 350) and will be a little wider than we expect. So... as a solution, I made a repository forking from react-native-size-matters and changed the default standard width and height to 375 and 812, which is the size of IphoneX and IPhoneXS. Here is the link. I want to make this public so that everyone can use it (like npm) but I'm using your code for most of the parts. I would like to hear from you whether you will mind me making this public or not.

Regards,
@tomo25

Hello @tomo25,

The base sizes are indeed an issue I'm aware of with this lib.
Stylesheets are a static world and it's impossible to change them on runtime.
I examined some env related solutions, but setting an env var in react-native is a pain, and using libs like react-native-config or react-native-dotenv require some extra dependencies, and I kinda like there are 0 dependencies for this lib.

So sure, go head and make it public :)
I would just appreciate if you'd state in the readme that it's a fork and explain why you made it.

Thanks,
@nirsky

commented

Thank you very much @nirsky . Will add some explanation about the reason why I make it and that it's a fork.

Cheers,
@tomo25