index.js 710 B

123456789101112131415161718192021222324
  1. (function(exports) {
  2. var RemoveProperty = function(less) {
  3. this._visitor = new less.visitors.Visitor(this);
  4. };
  5. RemoveProperty.prototype = {
  6. isReplacing: true,
  7. run: function (root) {
  8. return this._visitor.visit(root);
  9. },
  10. visitDeclaration: function (ruleNode, visitArgs) {
  11. if (ruleNode.name != '-some-aribitrary-property') {
  12. return ruleNode;
  13. } else {
  14. return [];
  15. }
  16. }
  17. };
  18. exports.install = function(less, pluginManager) {
  19. pluginManager.addVisitor( new RemoveProperty(less));
  20. };
  21. })(typeof exports === 'undefined' ? this['VisitorPlugin'] = {} : exports);