Skip to content

Commit cc0e0e3

Browse files
committed
add example output to readme for origins=include
1 parent c8529d9 commit cc0e0e3

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

readme.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,35 @@
1717
```js
1818
const extractCss = require('extract-css-core')
1919

20-
const css = await extractCss('http://www.projectwallace.com')
20+
const css = await extractCss('https://www.projectwallace.com')
21+
//=> html{font-size:100%} etc.
22+
```
23+
24+
Or, if you want more details:
25+
26+
```js
27+
const entries = await extractCss('https://www.projectwallace.com', {
28+
origins: 'include'
29+
})
30+
31+
// entries will look something like this
32+
[
33+
{
34+
href: 'https://www.projectwallace.com',
35+
type: 'link-or-import',
36+
css: '@font-face{font-display:swap;font-family:Teko;...'
37+
},
38+
{
39+
href: 'https://www.projectwallace.com/client/Seo.0f4fe72f.css',
40+
type: 'style',
41+
css: '.hero__text.svelte-qhblau a{color:var(--teal-400)}...'
42+
},
43+
{
44+
href: 'https://www.projectwallace.com',
45+
type: 'inline',
46+
css: '[x-extract-css-inline-style] { position: absolute; }'
47+
}
48+
]
2149
```
2250

2351
## Installation

0 commit comments

Comments
 (0)