We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4b3bf7c commit 07804faCopy full SHA for 07804fa
README.md
@@ -47,9 +47,25 @@ And consume them like regular React components:
47
48
<Label /> // => <div className="<autogenerated classname>">...</div>
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
67
## TODO
68
-* [ ] Support variants (generic pseudoclasses which can be toggled via JS).
69
* [ ] Support adding PostCSS transform to build pipeline (think autoprefixer).
70
71
[CSS modules]: https://github.com/css-modules/css-modules
0 commit comments