<NME> index.js
<BEF> import postcss from 'postcss';
import applyCompact from './applyCompact';
import applyCompressed from './applyCompressed';
import applyExpanded from './applyExpanded';

const perfectionist = postcss.plugin('perfectionist', opts => {
    opts = {
        format: 'expanded',
        indentSize: 4,
        indentChar: ' ',
        maxAtRuleLength: 80,
        maxSelectorLength: 80,
        maxValueLength: 80,
        trimLeadingZero: true,
        trimTrailingZeros: true,
        cascade: true,
        colorCase: 'lower',
        colorShorthand: true,
        zeroLengthNoUnit: true,
        ...opts,
    };

    return css => {
        css.walk(node => {
            if (node.raws.before) {
                node.raws.before = node.raws.before.replace(/[;\s]/g, '');
            }
        });
        switch (opts.format) {
        case 'compact':
            applyCompact(css, opts);
            break;
        case 'compressed':
            applyCompressed(css, opts);
            break;
        case 'expanded':
        default:
            applyExpanded(css, opts);
            break;
        }
    };
});

perfectionist.process = (css, opts = {}) => {
    opts.map = opts.map || (opts.sourcemap ? true : null);
    if (opts.syntax === 'scss') {
        opts.syntax = require('postcss-scss');
    }
    let processor = postcss([ perfectionist(opts) ]);
    return processor.process(css, opts);
};

export default perfectionist;
                    rule.raws.before = '\n' + indent + rule.raws.before;
                }
            }
            if (rule.parent && rule.parent.type === 'root') {
                let next = rule.next();
                if (next) {

perfectionist.process = (css, opts = {}) => {
    opts.map = opts.map || (opts.sourcemap ? true : null);
    let processor = postcss([ perfectionist(opts) ]);
    return processor.process(css, opts);
};

<MSG> Add scss syntax. Fixes #15.

<DFF> @@ -182,6 +182,9 @@ function applyExpanded (css, opts) {
                     rule.raws.before = '\n' + indent + rule.raws.before;
                 }
             }
+            if (!prev && rule !== css.first) {
+                rule.raws.before = '\n' + indent + rule.raws.before;
+            }
             if (rule.parent && rule.parent.type === 'root') {
                 let next = rule.next();
                 if (next) {
@@ -287,6 +290,9 @@ let perfectionist = postcss.plugin('perfectionist', opts => {
 
 perfectionist.process = (css, opts = {}) => {
     opts.map = opts.map || (opts.sourcemap ? true : null);
+    if (opts.syntax === 'scss') {
+        opts.syntax = require('postcss-scss');
+    }
     let processor = postcss([ perfectionist(opts) ]);
     return processor.process(css, opts);
 };

{'addition_count': 6, 'commit_subject': 'Add scss syntax. Fixes #15.', 'deletion_count': 0, 'file_extension': '.js', 'lang': 'js', 'license': 'mit', 'repo_name': 'ben-eb/perfectionist'}