
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-native-pss
Advanced tools
Platform Specific Styles. Create simple platform specific stylesheets for React Native
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
import StyleSheet from 'react-native-pss';
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
android: {
backgroundColor: 'red',
},
ios: {
backgroundColor: 'yellow',
},
alignItems: 'center',
},
});
If you want to use it alongside react-native's StyleSheet, just import it with a different name like:
import PlatformStyleSheet from 'react-native-pss';
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
*/
import React, { Component } from 'react';
import {
Text,
View
} from 'react-native';
import StyleSheet from 'react-native-pss';
export default class App extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
android: {
backgroundColor: 'red',
},
ios: {
backgroundColor: 'yellow',
},
alignItems: 'center',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
});
MIT
FAQs
Platform Specific Styles. Create simple platform specific stylesheets for React Native
We found that react-native-pss demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.