Skip to content

πŸ“ REM-like ruler for react native,for better screen size adaptation.

License

Notifications You must be signed in to change notification settings

react-native-china/react-native-rem-stylesheet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

react-native-rem-stylesheet

Tool to build all-device-capatible styles.

Install

yarn add react-native-rem-stylesheet

or

npm i --save react-native-rem-stylesheet

Demo

import React, { Component } from "react";
import { View, Text } from "react-native";
import StyleSheet from "react-native-rem-stylesheet";

export default class SomeComponent extends Component {
  render() {
    return (
      <View>
        <Text>Some text</Text>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  wrapper: {
    width: 320, //100% width
    height: 20, // will be 40 in 640 width device.
    padding: 10,
  },
  text: {
    fontSize: 12,
  },
});

About

πŸ“ REM-like ruler for react native,for better screen size adaptation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published