Skip to content

Instantly share code, notes, and snippets.

@oleersoy
Created January 25, 2019 19:54
Show Gist options
  • Select an option

  • Save oleersoy/e71fcf7f729c4501f881822c1d77b3c7 to your computer and use it in GitHub Desktop.

Select an option

Save oleersoy/e71fcf7f729c4501f881822c1d77b3c7 to your computer and use it in GitHub Desktop.
Sugarss example
const autoprefixer = require('autoprefixer');
var sugarss = require('sugarss');
var postcss = require('postcss');
var fs = require('fs');
fs.readFile('red.sss', 'utf-8', (err, css)=>{
postcss([autoprefixer])
.process(css, { parser: sugarss, from: './red.sss', to: './app.css' })
.then(result => {
fs.writeFile('./app.css', result.css, () => true)
if ( result.map ) {
fs.writeFile('./app.css.map', result.map, () => true)
}
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment