JSPM

gulp-image-set-plus

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

Gulp plugin to add future-proofed support for W3C-style image set notation.

Package Exports

  • gulp-image-set-plus

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 (gulp-image-set-plus) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Installation

npm install --save gulp-image-set-plus

Usage

var gulp = require('gulp')
var imageSet = require('gulp-image-set-plus')

gulp.task('image-set', function () {
  return gulp.src('my-file.css')
    .pipe(imageSet())
    .pipe(gulp.dest('dist'))
})

gulp.task('default', ['image-set'])

Input

.bg-img {
  background-image: image-set(url('my-img.png') 4x);
}

Output

.bg-img {
  background-image: url('my-img@x1.png');
  background-image: image-set(url('my-img@x1.png') 1x,url('my-img@x2.png') 2x, url('my-img@x3.png') 3x, url('my-img.png') 4x);
}