-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support media queries with React Native #203
Comments
@mxstbr any though on the subject ? |
Just so I understand correctly, are you looking to have this, height: 120;
@media (min-width: 600) {
width: 56;
} Go to, const styles = {
base: {
height: 120,
'@media (min-width: 600px)': {
height: 56,
},
},
} |
I'm curious what would media queries in RN do? What sort of problems are you trying to solve? Would you like to get something what https://github.com/aybadb/react-native-responsive does? |
@knowbody you can check this proposal https://gist.github.com/grabbou/72767db51f97fe86cfea It addresses the same kind of problem domain that media queries solve on the web. When you have an RN app that target ios, android, phones and tablets alike and need to adapt its layout depending on the device orientation and so on... I dont really like how react-native-responsive is implementing media queries, for me, media queries should be expressed as css rules, just like on the web. In that regard, Uranium is a much better prospect imho. Extended Stylesheet implemented the proposal above:
|
* Supports REM/Percent units * Supports Media Queries (Fixes styled-components#203)
As nobody has asked for this custom extension in more than half a year I doubt we'll include it in the library. On top of that many workarounds already exist that make media query functionality possible on ReactNative. Thank you for suggesting improvements to the library! |
Why didn't shripadk@d4fe1a9 get merged? Does it add support for this? I would love to use styled-components with RN but I need media queries. react-native-extended-stylesheet syntax is RN pojo nastiness... Seems like a really valid request. Please re-open. @shripadk Can you comment on this and if your fork is working open a PR to this lib please? |
So, is media-query not possible in React-Native? Why not support all CSS3? Media queries would be very helpful when making a responsive ui for tablets and phones. |
I'm open to it if someone wants to make a new PR and lots of tests. |
Any new information on this? what does community use right now? |
@hosseinalipour Look at the PR I linked above. It's really simple. See if you can replicate that into a new PR like Evan suggested. If that solution works for you locally, I'm sure someone could point you towards where a small test suite like that might live. I haven't used RN in a long time, but would love media queries to be available next time I need to. :) |
I'm working on a responsive, Theme UI-like library for React Native. It would be great if the I already got the media queries to work on native using the That said, if you try to use React Native's |
Is this something that's being considered? |
And it is here: https://github.com/nandorojo/dripsy Thank you very much for building this, I was missing |
Thanks for the fantastic project guys, I am primarily targeting RN and I though it would be awesome if styled components could provide support for media queries seamlessly in RN.
Turns out that there is a new very promising project to add media queries support to both React and React Native.
It would be pretty neat if a bridge would exist to embed this functionality so that I dont have to wrap my style component (which is already a wrapper) with Uranium wrapper.
The text was updated successfully, but these errors were encountered: