Skip to content

Commit 83d0270

Browse files
committed
Update README.md
Add usage instructions and an example.
1 parent d9f0ac4 commit 83d0270

File tree

1 file changed

+47
-1
lines changed

1 file changed

+47
-1
lines changed

README.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,47 @@
1-
# CSS-to-HTML
1+
# CSS-to-HTML
2+
3+
Generate HTML documents from just CSS.
4+
5+
6+
## Usage
7+
8+
```javascript
9+
import { cssToHtml } from 'css-to-html';
10+
11+
const css = 'p { color: purple; }';
12+
13+
const html = cssToHtml(css);
14+
```
15+
16+
17+
## Example
18+
19+
Input:
20+
```css
21+
h1 {
22+
color: grey;
23+
}
24+
p > button.rounded {
25+
background: #fff;
26+
border-radius: 8px;
27+
}
28+
p > button.rounded:hover {
29+
background: #ddd;
30+
}
31+
a img#logo {
32+
display: block;
33+
width: 1.5em;
34+
height: 1.5em;
35+
}
36+
```
37+
38+
Output:
39+
```html
40+
<body>
41+
<h1></h1>
42+
<p>
43+
<button class="rounded"></button>
44+
</p>
45+
<a><img id="logo"></a>
46+
</body>
47+
```

0 commit comments

Comments
 (0)