This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/csso/lib/replace/index.js

25 lines
744 B
JavaScript
Raw Normal View History

2019-08-11 18:48:02 +00:00
var walk = require('css-tree').walk;
var handlers = {
Atrule: require('./Atrule'),
AttributeSelector: require('./AttributeSelector'),
Value: require('./Value'),
Dimension: require('./Dimension'),
Percentage: require('./Percentage'),
Number: require('./Number'),
String: require('./String'),
Url: require('./Url'),
HexColor: require('./color').compressHex,
Identifier: require('./color').compressIdent,
Function: require('./color').compressFunction
};
module.exports = function(ast) {
walk(ast, {
leave: function(node, item, list) {
if (handlers.hasOwnProperty(node.type)) {
handlers[node.type].call(this, node, item, list);
}
}
});
};