JSPM

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

PostHTML-PostCSS plugin. Use PostCSS in HTML document.

Package Exports

  • posthtml-postcss

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

Readme

PostHTML-PostCSS

npm version Build Status Coverage Status

PostHTML plugin for PostCSS. Use PostCSS in HTML document

Usage

var posthtml = require('posthtml'),
    html = '<style>div { display: flex; }</style><div style="display: flex;">Text</div>',
    postcssPlugins = [require('autoprefixer')({ browsers: ['last 2 versions'] })],
    postcssOptions = {};

posthtml()
    .use(require('posthtml-postcss')(postcssPlugins, postcssOptions))
    .process(html)
    .then(function(result) {
        console.log(result.html);
        // <style>div { display: -webkit-flex;display: -ms-flexbox;display: flex; }</style><div style="display: -webkit-flex;display: -ms-flexbox;display: flex;">Text</div>
    })

License

MIT