Yes, basically, we could have some events hooked to toplevel elements that would only trigger a function when the event bubbles and it comes from a given type of element (having a certain class for instance).
By the way, I finally implemented custom styles in pretty much the same way as I implemented classes.