React Native Cls
React Native library to have classes like css. By WAAVI
Installation
npm install react-native-cls
or yarn add react-native-cls
How to use
clsStyles.js
;; const sizeStyles = size10: 10 size12: 12 size14: 14 size16: 16 size18: 18 size21: 21 size24: 24 size28: 28 size32: 32 size36: 36 size40: 40 size44: 44; const colorStyles = red: 'red' green: 'green' white: 'white' grey: 'grey' black: 'black' yellow: 'yellow'; const clsStyles = ClsStyles; const clsStylesWithSpacings = ClsStyles; ;
StyledText.js
;;;; static propTypes = cls: string style: any ; textClsStyles; { const style ...restProps = thisprops; return <Text style=this style ...restProps />; }
Example
<StyledText cls="title center red mt40 mb20" />
More examples in examples folder.