JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 40
  • Score
    100M100P100Q45648F
  • License MIT

Postcss plugin for generate miniatures image-set()

Package Exports

  • postcss-image-set-generator

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (postcss-image-set-generator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

postcss-image-set-generator Build Status npm version devDependency Status

Logo postcss-image-set-generator

About this plugin

This plugin add postcss function for image-set.

This function checks if only one argument was passed to it, it automatically makes thumbnails of the images according to the sizes previously set.

You must specify only one picture of the largest size and specify for which pixelity pixel it is used

Install

Prerequisites

  • Node v4+
  • C++11 compatible compiler such as gcc 4.8+, clang 3.0+ or MSVC 2013+
  • node-gyp and its dependencies (includes Python)
npm install postcss-image-set-generator --save-dev 
yarn add postcss-image-set-generator --dev

Example

/* Input */

.a {
    background: image-set(url("../img/bg.png") x3)
    background-image: image-set(url('img/icon-user.jpg') 288dpi)
    border-image: image-set(url(border-gold.png) x1.5)
}
.webp .a {
    background: image-set(url("../img/bg.webp") x3)
}

/* Output */

NPM