https://github.com/chilijung/react-native-stylesheet-normalize
normalize fontSize in different devices
https://github.com/chilijung/react-native-stylesheet-normalize
normalize react-native stylesheets
Last synced: 15 days ago
JSON representation
normalize fontSize in different devices
- Host: GitHub
- URL: https://github.com/chilijung/react-native-stylesheet-normalize
- Owner: chilijung
- Created: 2017-08-03T08:37:21.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-03T14:50:18.000Z (over 7 years ago)
- Last Synced: 2025-06-13T15:17:12.517Z (about 1 month ago)
- Topics: normalize, react-native, stylesheets
- Language: JavaScript
- Homepage:
- Size: 67.4 KB
- Stars: 6
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-styleSheet-normalize
[](https://travis-ci.org/Canner/react-native-stylesheet-normalize)
normalize fontSize in different devices
## Install
```
yarn add react-native-stylesheet-normalize
```## Why
In different devices there are different `pixelRatio`, `width` and `height`. So appearance should not be always the same, the appearance should adapt it's fontSize to match user's device. Use `normalizeText` extract from `react-native-elements` (see [here](https://github.com/react-native-training/react-native-elements/blob/master/src/helpers/normalizeText.js)).
## Usage
just replace your `StyleSheet.create` to `StyleSheetNormalize.create` and that's it!
```js
import StyleSheetNormalize from 'react-native-stylesheet-normalize';
const styles = StyleSheetNormalize.create({
// your styles here
// all `fontSize` value will wrap with `normalize()`
});
```## License
MIT