Skip to content

Commit 326178b

Browse files
committed
doc: update README
1 parent 4adec8a commit 326178b

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

README.md

+13-5
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@
1010
- [Motivation](#motivation)
1111
- [Installation & Usage](#installation-&-usage)
1212
- [Base components](#base-components)
13-
- [DOM components](#dom-components)
14-
- [Composite components](#composite-components)
13+
- [Custom composite components as bases](#custom-composite-components-as-bases)
1514
- [Variants](#variants)
16-
- [Named variants](#named-variants)
17-
- [Variants controlled with JS expression](#variants-controlled-with-js-expression)
15+
- [Prop variants](#prop-variants)
1816
- [TODO](#todo)
1917

2018
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
@@ -67,7 +65,7 @@ And consume them like regular React components:
6765
```js
6866
import {Label} from './styles.react.css'
6967

70-
<Label /> // => <div className="<autogenerated classname>">...</div>
68+
<Label /> // => <div class="<autogenerated classname>">...</div>
7169
```
7270

7371
## Base components
@@ -84,6 +82,14 @@ FancyButton {
8482
}
8583
```
8684

85+
Now `<FancyButton />` renders into `<button />`:
86+
87+
```js
88+
import {FancyButton} from './styles.react.css'
89+
90+
<FancyButton /> // => <button class="<autogenerated classname>">...</button>
91+
```
92+
8793
### Composite components
8894

8995
In fact any React components which accepts `className` props can be used as a
@@ -106,6 +112,7 @@ Variants is a mechanism which allows to define styling variants for a component.
106112
### Named variants
107113

108114
You can define additional styling variants for your components:
115+
109116
```css
110117
Label {
111118
color: red;
@@ -118,6 +125,7 @@ Label:emphasis {
118125

119126
They are compiled as CSS classes which then can be controlled from JS via
120127
`variant` prop:
128+
121129
```js
122130
<Label variant={{emphasis: true}} /> // sets both classes with `color` and `font-weight`
123131
```

0 commit comments

Comments
 (0)