Skip to content

gwillz/metalsmith-postcss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Metalsmith PostCSS

PostCSS integration for Metalsmith.

Key features

  • loading postcss.config.js files
  • target rewriting (.sss -> .css)
  • unit tests

Usage

const postcss = require('metalsmith-postcss')

new Metalsmith(__dirname)
.use(postcss({
    pattern: '**/*.{sss,css}',
    config: './postcss.config.js',
    // 'config' AND/OR inline (these will override config file settings)
    plugins: {
        'postcss-preset-env': {stage: 1},
        ...
    },
    map: {inline: true},
}))
.build(err => {
    if (err) throw err;
})

Notes

I wrote this plugin because I wasn't getting what I wanted from existing solutions. In a mindless coding rage I ended up with this.

Perhaps later when I'm feeling more bold, a pull-request into metalsmith-postcss would be more appropriate.

About

PostCSS plugin for Metalsmith

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors