|
1 | 1 | # css-vars-ponyfill
|
2 | 2 |
|
3 | 3 | [](https://www.npmjs.com/package/css-vars-ponyfill)
|
4 |
| -[](https://travis-ci.org/jhildenbiddle/css-vars-ponyfill) |
| 4 | +[](https://travis-ci.org/jhildenbiddle/css-vars-ponyfill) |
5 | 5 | [](https://www.codacy.com/app/jhildenbiddle/css-vars-ponyfill?utm_source=github.com&utm_medium=referral&utm_content=jhildenbiddle/css-vars-ponyfill&utm_campaign=Badge_Grade)
|
6 | 6 | [](https://codecov.io/gh/jhildenbiddle/css-vars-ponyfill)
|
7 | 7 | [](https://github.com/jhildenbiddle/css-vars-ponyfill/blob/master/LICENSE)
|
|
63 | 63 | git clone https://github.com/jhildenbiddle/css-vars-ponyfill.git
|
64 | 64 | ```
|
65 | 65 |
|
66 |
| -CDN ([unpkg.com](https://unpkg.com/) shown, also on [jsdelivr.net](https://www.jsdelivr.com/)): |
| 66 | +CDN ([jsdelivr.com](https://www.jsdelivr.com/) shown, also on [unpkg.com](https://unpkg.com/)): |
67 | 67 |
|
68 | 68 | ```html
|
69 |
| -<!-- file.html (latest v1.x.x) --> |
70 |
| - |
71 |
| -<script src="https://unpkg.com/css-vars-ponyfill@1"></script> |
72 |
| -<script> |
73 |
| - cssVars({ |
74 |
| - // ... |
75 |
| - }); |
76 |
| -</script> |
| 69 | +<!-- Latest v1.x.x --> |
| 70 | +<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@1"></script> |
77 | 71 | ```
|
78 | 72 |
|
79 | 73 | ## Examples
|
@@ -382,6 +376,16 @@ When `true`, the ponyfill will only transform custom properties, generate CSS, a
|
382 | 376 | cssVars({
|
383 | 377 | onlyLegacy: true // default
|
384 | 378 | });
|
| 379 | + |
| 380 | +cssVars({ |
| 381 | + // Treat all browsers as legacy |
| 382 | + onlyLegacy: false |
| 383 | +}); |
| 384 | + |
| 385 | +cssVars({ |
| 386 | + // Treat Edge 15/16 as legacy |
| 387 | + onlyLegacy: !(/Edge\/1[56]\./i.test(navigator.userAgent)) |
| 388 | +}); |
385 | 389 | ```
|
386 | 390 |
|
387 | 391 | ### options.onlyVars
|
@@ -725,7 +729,7 @@ cssVars({
|
725 | 729 | 1. **node**: The source node `object` reference
|
726 | 730 | 1. **url**: The source URL `string` (`<link>` href, `@import` url, or page url for `<style>` data)
|
727 | 731 |
|
728 |
| -Callback after CSS data has been collected from each node and *before* CSS custom properties have been transformed. Allows modifying the CSS data before it is transformed by returning any `string` value (or `false` to skip). |
| 732 | +Callback after CSS data has been collected from each node. Allows modifying the CSS data before it is added to the final output by returning any `string` value or skipping the CSS data by returning `false`, `null`, or an empty string (`""`). |
729 | 733 |
|
730 | 734 | **Note:** The order in which `<link>` and `@import` CSS data is "successfully" collected (thereby triggering this callback) is not guaranteed as these requests are asynchronous.
|
731 | 735 |
|
|
0 commit comments