From 135667cb0bfcaa6d82a170efe355cf6bf3638170 Mon Sep 17 00:00:00 2001 From: vitalets Date: Mon, 25 Apr 2016 00:12:28 +0300 Subject: [PATCH] readme --- README.md | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 01c074b..d806196 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![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) Extend [React Native](https://facebook.github.io/react-native/) stylesheets with media-queries, variables, themes, -relative units, percents, math operations, scaling and other stuff. +relative units, percents, math operations, scaling and other styling stuff. @@ -76,12 +76,8 @@ npm i react-native-extended-stylesheet --save // calculate styles EStyleSheet.build(); - - // calculate styles with passed variables - EStyleSheet.build({ - textColor: '#0275d8' - }); ``` + \[[top](#)\] ## Features @@ -115,6 +111,24 @@ export default { import theme from '.theme'; EStyleSheet.build(theme); ``` + +You can define nested variables and access them via dot path: +```js +// entry +EStyleSheet.build({ + button: { + size: 10 + } +}); + +// component +const styles = EStyleSheet.create({ + text: { + color: '$button.size' + } +}); +``` + \[[top](#)\] ### Local variables