File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -47,9 +47,25 @@ And consume them like regular React components:
47
47
48
48
<Label /> // => <div className="<autogenerated classname>">...</div>
49
49
50
+ ## Variants
51
+
52
+ You can define additional styling variants for your components:
53
+
54
+ Label {
55
+ color: red;
56
+ }
57
+
58
+ Label:emphasis {
59
+ font-weight: bold;
60
+ }
61
+
62
+ They are compiled as CSS classes which then can be controlled from JS via
63
+ ` variant ` prop:
64
+
65
+ <Label variant={{emphasis: true}} /> // sets both classes with `color` and `font-weight`
66
+
50
67
## TODO
51
68
52
- * [ ] Support variants (generic pseudoclasses which can be toggled via JS).
53
69
* [ ] Support adding PostCSS transform to build pipeline (think autoprefixer).
54
70
55
71
[ CSS modules ] : https://github.com/css-modules/css-modules
You can’t perform that action at this time.
0 commit comments