Skip to content

Commit 404b376

Browse files
committed
update docs
1 parent 62de2ef commit 404b376

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ node_modules
2626

2727
# Users Environment Variables
2828
.lock-wscript
29+
30+
.DS_Store

api.md

+14
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ If you want React to do native well, you need to use inline styles. But, you ca
66

77
You can create a javascript stylesheet similar to what you would see with a CSS precompiler but you can actually use variables calculated at runtime!
88

9+
```
10+
// *very* simple example - more advance capabilities are not demonstrated here
11+
var stylesheet = require('react-css-builder').register({
12+
myClass: {
13+
color: 'white'
14+
}
15+
});
16+
17+
var styleAttributes = stylesheet.css('myClass');
18+
...
19+
render: function() {
20+
return <div style={styleAttributes}/>
21+
}
22+
```
923

1024
Installation
1125
--------------

0 commit comments

Comments
 (0)