You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
576 B

4 years ago
  1. var walk = require('css-tree').walk;
  2. var handlers = {
  3. Atrule: require('./Atrule'),
  4. Comment: require('./Comment'),
  5. Declaration: require('./Declaration'),
  6. Raw: require('./Raw'),
  7. Rule: require('./Rule'),
  8. TypeSelector: require('./TypeSelector'),
  9. WhiteSpace: require('./WhiteSpace')
  10. };
  11. module.exports = function(ast, options) {
  12. walk(ast, {
  13. leave: function(node, item, list) {
  14. if (handlers.hasOwnProperty(node.type)) {
  15. handlers[node.type].call(this, node, item, list, options);
  16. }
  17. }
  18. });
  19. };