JSPM

rework-image-set-plus

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

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

    Package Exports

    • rework-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 (rework-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

    npm install --save rework-image-set-plus

    Usage

    var fs = require('fs')
    var rework = require('rework')
    var imageSet = require('rework-image-set-plus')
    
    var css = fs.readFileSync('css/my-file.css', 'utf8').toString()
    var out = rework(css).use(imageSet()).toString()

    Input

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

    Output

    .bg-img {
      background-image: url('my-img.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);
    }