Revisiting John's suggestion about using double-dispatch. We should remove this visit method here, and in ClassVisitor, instead, implement in Visitor:

void visit(Node node) => node.visit(this);

Ideally the 'visit' method in node should be called 'accept', but that's ok. node.visit will know which call to make, in particular, a StyleSheet node will will call visitStyleSheet.