JSPM

react-native-platform-stylesheet

0.0.6
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 396
  • Score
    100M100P100Q90346F
  • License MIT

Platform Specific Stylesheet for React Native

Package Exports

  • react-native-platform-stylesheet

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-platform-stylesheet) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

React Native Platform Stylesheet

Seperated out the F8StyleSheet to a module.

Get started

  1. npm install react-native-platform-stylesheet

  2. Use it in your project:

import { create } from 'react-native-platform-stylesheet';


const Profile = () => (
  <View style={styles.container}>
    {/* ... */}
  </View>
);

const styles = create({
  container: {
    flex: 1,
    ios: {
      backgroundColor: 'salmon'
    },
    android: {
      backgroundColor: 'tomato'
    }
  }
});

or

import { create } from 'react-native-platform-stylesheet';


const Profile = () => (
  <View style={styles.container}>
    {/* ... */}
  </View>
);

const styles = create({
  container: {
    flex: 1
  },
  ios: {
    container: {
      backgroundColor: 'salmon'
    }
  },
  android: {
    container: {
      backgroundColor: 'tomato'
    }
  }
});

Note: in the second example, make sure that ios and android styles are defined in the end of the object.