I'm not sure if this is a bug or I'm doing something wrong, but this doesn't seem to work:
const csstree = require('css-tree');
const ast = csstree.parse('color: red; background-color: blue', { context: 'declarationList' });
csstree.walk(ast, {
visit: 'Declaration',
enter: function(node) {
console.log(node);
}
});
csstree.walk(ast, function(node) { console.log(node) }) however works fine; also, visit: 'Identifier' and anything other than visit: 'Declaration' seems to also work as expected.
Any thoughts?
I'm not sure if this is a bug or I'm doing something wrong, but this doesn't seem to work:
csstree.walk(ast, function(node) { console.log(node) })however works fine; also,visit: 'Identifier'and anything other thanvisit: 'Declaration'seems to also work as expected.Any thoughts?