Skip to content

stakit/stakit-postcss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stakit-postcss

Stakit + PostCSS

NPM version

Installation

npm i stakit-postcss

Example

var stakit = require('stakit')
var path = require('path')
var postcss = require('stakit-postcss')

stakit()
  .use(postcss(path.join(__dirname, './style.css')))
  .routes(() => ['/'])
  .render(render)
  .output()

API

postcss(entry, opts, postcssOpts)

Returns a Stakit plugin that runs entry through PostCSS and includes it in the files outputted by Stakit.

opts are stakit-postcss specific options (with defaults):

  • opts.plugins: [] - an array of PostCSS plugins
  • opts.includeStyle: true - whether a <link> tag should automatically be included in the <head>
  • opts.output: '/bundles/bundle.css' - output location within the Stakit's output directory

postcssOpts are simply forwarded to PostCSS. The from value is always set to entry.