index.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. var prepare = require('./prepare/index');
  2. var mergeAtrule = require('./1-mergeAtrule');
  3. var initialMergeRuleset = require('./2-initialMergeRuleset');
  4. var disjoinRuleset = require('./3-disjoinRuleset');
  5. var restructShorthand = require('./4-restructShorthand');
  6. var restructBlock = require('./6-restructBlock');
  7. var mergeRuleset = require('./7-mergeRuleset');
  8. var restructRuleset = require('./8-restructRuleset');
  9. module.exports = function(ast, options) {
  10. // prepare ast for restructing
  11. var indexer = prepare(ast, options);
  12. options.logger('prepare', ast);
  13. mergeAtrule(ast, options);
  14. options.logger('mergeAtrule', ast);
  15. initialMergeRuleset(ast);
  16. options.logger('initialMergeRuleset', ast);
  17. disjoinRuleset(ast);
  18. options.logger('disjoinRuleset', ast);
  19. restructShorthand(ast, indexer);
  20. options.logger('restructShorthand', ast);
  21. restructBlock(ast);
  22. options.logger('restructBlock', ast);
  23. mergeRuleset(ast);
  24. options.logger('mergeRuleset', ast);
  25. restructRuleset(ast);
  26. options.logger('restructRuleset', ast);
  27. };