react-native-style

0.0.6 • Public • Published

With react-native-style you can use different templates for styles like media query in css. Use condition value as pixels, but value of style property in point as default in react-native. react-native-style has 2 variables for condition.

height - height of screen in pixels. width - width of screen in pixels.

Install

$ npm i react-native-style --save

Usage Example.

'use strict';
import React, {
  AppRegistry,
  Text,
  View
} from 'react-native';

import styleSheet from 'react-native-style';

class DemoApp extends Component {
  render() {
    return (
      <View style={styles.container}>
      <Text>Some Text</Text>
      </View>
    );
  }
}

const styles = styleSheet([{
  'height <= 750': {
  	container: {
      height: deviceHeight,
      width: deviceWidth,
      backgroundColor: '#8cc5b4'
    }
  }
}]);

AppRegistry.registerComponent('DemoApp', () => DemoApp);

Readme

Keywords

Package Sidebar

Install

npm i react-native-style

Weekly Downloads

1

Version

0.0.6

License

GPL-3.0

Last publish

Collaborators

  • antonyashyn