vitalets / react-native-extended-stylesheet

Extended StyleSheets for React Native
MIT License
2.93k stars 132 forks source link

add test and support @media screen properties #132

Closed ItsWendell closed 4 years ago

ItsWendell commented 4 years ago

This adds support for thescreen media type, next to all the Platform.OS types of React Native. This makes it easier for compatibility with converting browser CSS to React Native CSS with external libraries for example like Styled System / Emotion / Styled Components.

The current media query would work in the browser, but not using extended stylesheet:

@media screen and (min-width: 40rem)

This PR simply replaces the word screen with the current platform: Platform.OS to add support for media queries like this.

As an example, I'm using this library in my newly published emotion-native-extended which basically adds support for responsive CSS in JS as for React Native using Emotion and Extended Stylesheet. This allows for support for third party extensions for Styled Component / Emotion but these sometimes rely on 'browser' media queries, for example: Styled System.

Merging this PR might make it easier for browser people to integrate and use their styling for the native platform.

stale[bot] commented 4 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

ItsWendell commented 4 years ago

Not sure why the bot decided that this was not a good idea, would love to hear someone's opinion on it!