ben-eb / perfectionist

Beautify CSS files.
MIT License
229 stars 14 forks source link

Do not remove the single-line comments #13

Closed yisibl closed 8 years ago

yisibl commented 8 years ago

CSS preprocessor in both single-line comments.

SCSS

//comment
.foo {
  //comment
}

Less

//comment
.foo {
  //comment
}
yisibl commented 8 years ago

Fix https://github.com/ben-eb/perfectionist/commit/0de874b583bd37bf6ab31a1995a9d06e3496dd29

We can use:

var postcss       = require('postcss');
var perfectionist = require('perfectionist');
var scss          = require('postcss-scss');

postcss([perfectionist()])
    .process(data, {
      syntax: scss
    })
    .then(function(result) {
      console.log(result.css);
    })
ben-eb commented 8 years ago

:+1: