Skip to content

Commit 4a1f8b2

Browse files
author
pemrouz
committed
docs: update readme
1 parent b277361 commit 4a1f8b2

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,30 @@
22
[![Coverage Status](https://coveralls.io/repos/rijs/precss/badge.svg?branch=master&service=github)](https://coveralls.io/github/rijs/precss?branch=master)
33
[![Build Status](https://travis-ci.org/rijs/precss.svg)](https://travis-ci.org/rijs/precss)
44

5-
Pre-applies CSS styles to a component before rendering it. Using the following syntax:
5+
Extends the [rendering pipeline]() to prepend stylesheet(s) for a component. It will be added to either the start of the shadow root if one exists, or scoped and added once in the `head`.
6+
7+
Using the following syntax:
68

79
```html
810
<component-name css="styles.css">
911
```
1012

11-
A style tag with the CSS styles from the specified resource will be added to the beginning of the Shadow Root
13+
A `style` tag with the CSS styles from the specified resource (`ripple('styles.css')`) will be added to the beginning of the shadow root.
1214

1315
```html
14-
<style resource="styles.css"> /* ... */ </style>
16+
<component-name css="styles.css">
17+
#shadow-root
18+
<style resource="styles.css"> /* ... */ </style>
1519
```
1620

17-
If there is no Shadow DOM, the styles will scoped and added to the end of the document head. The style tags are deduped so there will only be one for each specfic CSS resource in use.
21+
If there is no shadow, the styles will scoped and added to the end of the document `head`. The style tags are deduped so there will only be one for each specfic CSS resource in use.
1822

1923
Multiple CSS modules are also possible:
2024

2125
```html
2226
<component-name css="component-styles.css fa-circle.css fa-square.css">
27+
#shadow-root
28+
<style resource="component-styles.css"> /* ... */ </style>
29+
<style resource="fa-circle.css"> /* ... */ </style>
30+
<style resource="fa-square.css"> /* ... */ </style>
2331
```

0 commit comments

Comments
 (0)