example/plugin.js
function(scope, config) {
        var isAngry = config.mood === 'angry',
            isColorExist;

        console.log(
            '\nProcessing command: ' + scope.command.name
        );

        if (scope.decl.prop === 'content') {
            scope.decl.value = isAngry ?
                '"BAD BAD NOT GOOD"' :
                '"GOOD GOOD NOT BAD"';
        }

        isColorExist = scope.rule.decls.some(function(decl) {
            if (decl.prop === 'color') {
                decl.value = isAngry ? 'red' : 'pink';

                return true;
            }

            if ( ! isAngry && decl.prop === 'font-size') {
                decl.value = '48px';
            }
        });

        if ( ! isColorExist) {
            scope.rule.append({
                prop : 'color',
                value : isAngry ? 'red' : 'pink'
            });
        }

        (scope.angrifiedCount || (scope.angrifiedCount = 0));
        scope.angrifiedCount++;
    }
function(scope, config) {
        var isAngry = config.mood === 'angry',
            isColorExist;

        console.log(
            '\nProcessing command: ' + scope.command.name
        );

        if (scope.decl.prop === 'content') {
            scope.decl.value = isAngry ?
                '"BAD BAD NOT GOOD"' :
                '"GOOD GOOD NOT BAD"';
        }

        isColorExist = scope.rule.decls.some(function(decl) {
            if (decl.prop === 'color') {
                decl.value = isAngry ? 'red' : 'pink';

                return true;
            }

            if ( ! isAngry && decl.prop === 'font-size') {
                decl.value = '48px';
            }
        });

        if ( ! isColorExist) {
            scope.rule.append({
                prop : 'color',
                value : isAngry ? 'red' : 'pink'
            });
        }

        (scope.angrifiedCount || (scope.angrifiedCount = 0));
        scope.angrifiedCount++;
    }
function ( scope , config ) { var isAngry = config . mood === 'angry' , isColorExist ; console . log ( '\nProcessing command: ' + scope . command . name ) ; if ( scope . decl . prop === 'content' ) { scope . decl . value = isAngry ? '"BAD BAD NOT GOOD"' : '"GOOD GOOD NOT BAD"' ; } isColorExist = scope . rule . decls . some ( function ( decl ) { if ( decl . prop === 'color' ) { decl . value = isAngry ? 'red' : 'pink' ; return true ; } if ( ! isAngry && decl . prop === 'font-size' ) { decl . value = '48px' ; } } ) ; if ( ! isColorExist ) { scope . rule . append ( { prop : 'color' , value : isAngry ? 'red' : 'pink' } ) ; } ( scope . angrifiedCount || ( scope . angrifiedCount = 0 ) ) ; scope . angrifiedCount ++ ; }
Will be called on each parsed command
@param {Object} scope
@param {File[]} scope.files Parsed input files
@param {File} scope.file Current processing file node
@param {Rule} scope.rule Current processing rule node
@param {Decl} scope.decl Current processing declaration node
@param {Command} scope.command Current processing command
@param {Object} config Plugin config for processing file
Will be called on each parsed command