Skip to content

Commit 07804fa

Browse files
committed
doc: document variants
1 parent 4b3bf7c commit 07804fa

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

README.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,25 @@ And consume them like regular React components:
4747

4848
<Label /> // => <div className="<autogenerated classname>">...</div>
4949

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+
5067
## TODO
5168

52-
* [ ] Support variants (generic pseudoclasses which can be toggled via JS).
5369
* [ ] Support adding PostCSS transform to build pipeline (think autoprefixer).
5470

5571
[CSS modules]: https://github.com/css-modules/css-modules

0 commit comments

Comments
 (0)