Skip to content

Calling walk on a DeclarationList with visit: Declaration doesn't work #114

Description

@fstanis

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions