A classy approach to manage your react native styles.
A classy approach.
Did you ever want to organize your styles properly? This library contains an easy to use API that lets you organize your styles in a classy way.
Installation
npm install react-native-use-styles --save
Usage
Using styles
importuseStylesfrom'./my-namespaced-styles';constcomponent=()⇒{consts=useStyles();return(<Textstyles={s`.global .namespaced`}>
Hello World
</Text>);}
Note that we are classy now, and nobody would deny it. Next we'll define our .global and .namespaced style to use them in our components as we are doing in this example.
Alo! If you are interested in React Native or not, you are more than welcome to contribute to this new project we are doing to manage Styles.
We have different kinds of issues to work on: code, docs, tests and more.
rootstrap / react-native-use-styles
A classy approach to manage your react native styles.
A classy approach.
Did you ever want to organize your styles properly? This library contains an easy to use API that lets you organize your styles in a classy way.
Installation
Usage
Using styles
Note that we are classy now, and nobody would deny it. Next we'll define our
.global
and.namespaced
style to use them in our components as we are doing in this example.Global styles
global-styles.js
We are using aliases or shortcuts to define our styles. This is equivalent to do: