# postcss-image-set-polyfill

> PostCSS plugin for fallback image-set

Latest version **1.0.0** (published 2019-03-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-image-set-polyfill
pnpm add postcss-image-set-polyfill
yarn add postcss-image-set-polyfill
bun add postcss-image-set-polyfill
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-03-07 |
| First published | 2017-02-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.0.0 |
| Dependencies | 3 |
| Unpacked size | 24.6 KB |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 44 |
| Author | SuperOl3g |
| Maintainers | superol3g |
| Keywords | postcss, css, postcss-plugin, image-set, background, image |

## Links

- npm: https://www.npmjs.com/package/postcss-image-set-polyfill
- Repository: https://github.com/SuperOl3g/postcss-image-set-polyfill
- Homepage: https://github.com/SuperOl3g/postcss-image-set-polyfill#readme
- Issues: https://github.com/SuperOl3g/postcss-image-set-polyfill/issues
- npm.io page: https://npm.io/package/postcss-image-set-polyfill

## Dependencies (3)

- [postcss](https://npm.io/package/postcss.md) ^7.0.14
- [postcss-value-parser](https://npm.io/package/postcss-value-parser.md) ^3.3.1
- [postcss-media-query-parser](https://npm.io/package/postcss-media-query-parser.md) ^0.2.3

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-03-07
- 0.4.4 — 2017-09-07
- 0.4.3 — 2017-07-16
- 0.4.2 — 2017-07-16
- 0.4.1 — 2017-07-16
- 0.4.0 — 2017-07-14
- 0.3.5 — 2017-06-12
- 0.3.4 — 2017-05-23
- 0.3.3 — 2017-05-06
- 0.3.2 — 2017-05-01
- 0.3.1 — 2017-02-25
- 0.3.0 — 2017-02-25
- 0.2.3 — 2017-02-14
- 0.2.2 — 2017-02-11
- 0.2.1 — 2017-02-09
- … 1 more at https://npm.io/package/postcss-image-set-polyfill/versions

## README

# postcss-image-set-polyfill [![Build Status](https://travis-ci.org/SuperOl3g/postcss-image-set-polyfill.svg)](https://travis-ci.org/SuperOl3g/postcss-image-set-polyfill) [![npm version](https://badge.fury.io/js/postcss-image-set-polyfill.svg)](https://badge.fury.io/js/postcss-image-set-polyfill)

[PostCSS] plugin for [polyfilling](http://caniuse.com/#feat=css-image-set) [`image-set`](https://drafts.csswg.org/css-images-4/#image-set-notation) CSS function.

[PostCSS]: https://github.com/postcss/postcss

```css
/* Input example */
.foo {
    background-image: image-set(url(img/test.png) 1x,
                                url(img/test-2x.png) 2x,
                                url(my-img-print.png) 600dpi);
}
```

```css
/* Output example */
.foo {
    background-image: url(img/test.png);
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .foo {
        background-image: url(img/test-2x.png);
    }
}


@media (-webkit-min-device-pixel-ratio: 6.25), (min-resolution: 600dpi) {
    .foo {
        background-image: url(my-img-print.png);
    }
}
```
<a href="https://astexplorer.net/#/gist/86d1248cc4628f850454d3191c95efec/3bbf606fe0ef2662917a845aa16a715d06435650" target="_blank">→Try it online←</a>


❗️ Resolution media query is supported only by IE9+.

## Installation

`npm i postcss-image-set-polyfill -D`

> ️❕ NodeJS version must be 6+.

## Usage

```js
var postcssImageSet = require('postcss-image-set-polyfill');

postcss([postcssImageSet]).process(YOUR_CSS, /* options */);
```

See [PostCSS] docs for examples for your environment.


### ⚠️️ Warning

If you use [autoprefixer](https://github.com/postcss/autoprefixer), place this plugin before it to prevent styles duplication.

---
_Source: https://npm.io/package/postcss-image-set-polyfill · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
