react-native-pss
Platform Specific Styles. Create simple platform specific stylesheets for React Native.
Apply Platform specific styles to components by specifying android and ios keys in the component's style property.
Installation
#npm npm install --save react-native-pss #yarn yarn add react-native-pss
The below snippet will create background color 'red' on android and 'yellow' on ios
; const styles = StyleSheet;
If you want to use it alongside react-native's StyleSheet, just import it with a different name like:
;
Since it overrides React Native's default stylesheet function all other styles should work normally.
A simple implementation example:
/** * react-native-pss example * https://github.com/DaniAkash/react-native-pss */ ;;; { return <View style=stylescontainer> <Text style=styleswelcome> Welcome to React Native! </Text> </View> ; } const styles = StyleSheet;
License
MIT