Skip to content

Commit afbd562

Browse files
author
Bart Veneman
committed
update readme to reflect changes to api
1 parent dc71693 commit afbd562

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

readme.md

+7-11
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,7 @@
44
</div>
55

66
[![NPM Version](https://img.shields.io/npm/v/extract-css-core.svg)](https://www.npmjs.com/package/extract-css-core)
7-
[![Weekly downloads](https://img.shields.io/npm/dw/extract-css-core.svg)](https://www.npmjs.com/package/extract-css-core)
87
![Node.js CI](https://github.com/bartveneman/extract-css-core/workflows/Node.js%20CI/badge.svg)
9-
[![Known Vulnerabilities](https://snyk.io/test/github/bartveneman/extract-css-core/badge.svg)](https://snyk.io/test/github/bartveneman/extract-css-core)
10-
![Dependencies Status](https://img.shields.io/david/bartveneman/extract-css-core.svg)
11-
![Dependencies Status](https://img.shields.io/david/dev/bartveneman/extract-css-core.svg)
12-
[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
13-
[![Project: Wallace](https://img.shields.io/badge/Project-Wallace-29c87d.svg)](https://www.projectwallace.com/oss)
14-
158
## Usage
169

1710
```js
@@ -32,14 +25,19 @@ const entries = await extractCss('https://www.projectwallace.com', {
3225
[
3326
{
3427
href: 'https://www.projectwallace.com',
35-
type: 'link-or-import',
28+
type: 'link',
3629
css: '@font-face{font-display:swap;font-family:Teko;...'
3730
},
3831
{
3932
href: 'https://www.projectwallace.com/client/Seo.0f4fe72f.css',
4033
type: 'style',
4134
css: '.hero__text.svelte-qhblau a{color:var(--teal-400)}...'
4235
},
36+
{
37+
href: 'https://www.projectwallace.com/client/some-css-file.css',
38+
type: 'import',
39+
css: '.some-css {}'
40+
},
4341
{
4442
href: 'https://www.projectwallace.com',
4543
type: 'inline',
@@ -70,9 +68,7 @@ CSS-in-JS styling and inline styles 👎.
7068

7169
This module uses an instance of Chromium to render a page. This has the benefit
7270
that most of the styles can be rendered, even when generated by JavaScript. The
73-
[Puppeteer CSSCoverage API](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#coveragestartcsscoverageoptions)
74-
is the power behind finding most of the CSS. Additionally, the
75-
`document.styleSheets` API is used to get CSS-in-JS styling. Lastly, a plain old `document.querySelectorAll('[style]')` finds all inline styling.
71+
`document.styleSheets` API is used to get all styles, including CSS-in-JS. Lastly, a plain old `document.querySelectorAll('[style]')` finds all inline styling.
7672

7773
## API
7874

0 commit comments

Comments
 (0)