Skip to content
Stakit transform to inline critical CSS
JavaScript CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example
.gitignore
.npmignore
.npmrc
index.js
package.json
readme.md

readme.md

stakit-critical-css

Stakit transform to inline critical, csso optimized CSS using dropcss.

Installation

npm i stakit-critical-css

Usage

var stakit = require('stakit')
var inlineCriticalCSS = require('stakit-critical-css')

var app = require('.')

stakit()
  .use(stakit.copy([ 'style.css' ])) // or get it from stakit-postcss
  .transform(inlineCriticalCSS, { src: 'style.css' })
  .output()

API

stakitCriticalCSS(opts)

Concats the stream of the file at opts.src and uses that as the raw CSS. Returns a hstream transform that prepends the optimized critical CSS to the head in a <style> tag.

You can’t perform that action at this time.