Skip to content

Commit 135667c

Browse files
author
vitalets
committed
readme
1 parent c80321f commit 135667c

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Coverage Status](https://coveralls.io/repos/github/vitalets/react-native-extended-stylesheet/badge.svg?branch=master)](https://coveralls.io/github/vitalets/react-native-extended-stylesheet?branch=master)
66

77
Extend [React Native](https://facebook.github.io/react-native/) stylesheets with media-queries, variables, themes,
8-
relative units, percents, math operations, scaling and other stuff.
8+
relative units, percents, math operations, scaling and other styling stuff.
99

1010
<img align="right" src="https://raw.githubusercontent.com/vitalets/react-native-extended-stylesheet/master/example/screenshot.png">
1111

@@ -76,12 +76,8 @@ npm i react-native-extended-stylesheet --save
7676

7777
// calculate styles
7878
EStyleSheet.build();
79-
80-
// calculate styles with passed variables
81-
EStyleSheet.build({
82-
textColor: '#0275d8'
83-
});
8479
```
80+
8581
\[[top](#)\]
8682

8783
## Features
@@ -115,6 +111,24 @@ export default {
115111
import theme from '.theme';
116112
EStyleSheet.build(theme);
117113
```
114+
115+
You can define nested variables and access them via dot path:
116+
```js
117+
// entry
118+
EStyleSheet.build({
119+
button: {
120+
size: 10
121+
}
122+
});
123+
124+
// component
125+
const styles = EStyleSheet.create({
126+
text: {
127+
color: '$button.size'
128+
}
129+
});
130+
```
131+
118132
\[[top](#)\]
119133

120134
### Local variables

0 commit comments

Comments
 (0)