Skip to content

Commit 02e6530

Browse files
committed
Add CDN URL version lock notice and CDN links
1 parent eed23ad commit 02e6530

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

docs/index.md

+13-18
Original file line numberDiff line numberDiff line change
@@ -61,30 +61,15 @@ A [ponyfill](https://ponyfill.com/) that provides client-side support for [CSS c
6161
npm install css-vars-ponyfill
6262
```
6363

64-
```js
65-
import cssVars from 'css-vars-ponyfill';
66-
67-
cssVars({
68-
// Options...
69-
});
70-
```
64+
**CDN**
7165

72-
**CDN** ([jsdelivr.com](https://www.jsdelivr.com/) shown, also on [unpkg.com](https://unpkg.com/))
66+
Available on [jsdelivr](https://www.jsdelivr.com/package/npm/css-vars-ponyfill) (below), [unpkg](https://unpkg.com/browse/css-vars-ponyfill/), and other CDN services that auto-publish npm packages.
7367

7468
```html
75-
<!-- index.html -->
76-
7769
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
78-
<script src="main.js"></script>
7970
```
8071

81-
```js
82-
/* main.js */
83-
84-
cssVars({
85-
// Options...
86-
});
87-
```
72+
!> Note the `@` version lock in the URLs above. This prevents breaking changes in future releases from affecting your project and is therefore the safest method of loading dependencies from a CDN. When a new major version is released, you will need to manually update your CDN URLs by changing the version after the `@` symbol.
8873

8974
## Usage
9075

@@ -131,6 +116,16 @@ div {
131116
}
132117
```
133118

119+
Call the ponyfill with your preferred [options](#options):
120+
121+
```js
122+
/* main.js */
123+
124+
cssVars({
125+
// Options...
126+
});
127+
```
128+
134129
Output:
135130

136131
```css

0 commit comments

Comments
 (0)