You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api.md
+38-14Lines changed: 38 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -115,13 +115,19 @@ var myStyle = stylesheet.get('myStyleClass').attr({color: 'white'}).css();
115
115
// will be {color: 'white', backgroundColor: 'black'}
116
116
```
117
117
118
-
119
118
#### vars(variables)
120
119
****variables***: Object specifying additional variables to be made accessable to the styleset function or referenced mixin functions as ```this.get("varName")```
121
120
122
121
See [variables usage](#project/jhudson8/react-css-builder/section/Usage/Variables) for more details.
123
122
124
123
124
+
#### css()
125
+
Return the style attributes object created using the StylesetBuilder.
126
+
127
+
See [variables usage](#project/jhudson8/react-css-builder/section/Usage/Variables) or [mixins usage](#project/jhudson8/react-css-builder/section/Usage/Mixins) for more details.
128
+
129
+
130
+
125
131
### StyleContext
126
132
This is the object provided as the single styleset if the styleset value is a function rather than a simple object specifying the style attributes.
127
133
@@ -245,15 +251,29 @@ See [Mixins API](#project/jhudson8/react-css-builder/method/react-css-builder/mi
245
251
246
252
Mixins can return any number of attributes that should be applied to a styleset.
247
253
254
+
Mixins can be registered [globally](#project/jhudson8/react-css-builder/method/react-css-builder/mixin) or scoped to a [single stylesheet](#project/jhudson8/react-css-builder/method/Stylesheet/mixin?focus=outline)
255
+
```
256
+
// the mixin can have any number of arguments provided when the mixin is referenced
var stylesheet = require('react-css-builder').register({
250
273
251
274
myClassUsingMixins: function(css) {
252
275
return css
253
-
.mixin('the-mixin-name', param1, param2, ...)
254
-
.attr({
255
-
// include any additional attributes
256
-
})
276
+
.mixin('vendor-prefix', 'borderRadius', '3px')
257
277
.val();
258
278
}
259
279
});
@@ -263,6 +283,19 @@ Mixins can return any number of attributes that should be applied to a styleset.
263
283
#### Variables
264
284
See [Variables API](#project/jhudson8/react-css-builder/method/react-css-builder/vars) to understand how to register variables
265
285
286
+
Variables can be set [globally](#project/jhudson8/react-css-builder/method/react-css-builder/vars) or scoped to a [single stylesheet](#project/jhudson8/react-css-builder/method/Stylesheet/vars) or set when [getting individual styles attributes](#project/jhudson8/react-css-builder/method/StylesetBuilder/vars?focus=outline).
0 commit comments