Which high-level selectors to use for key bindings?


I’ve been spending some time working on my bindings, and mostly I can get them to do what I want, but I have a best-practices question.

In terms of high level selectors, I haven’t been able to figure out when it’s appropriate to use different options. For example, in the DOM it seems like body, atom-workspace, and .workspace are effectively the same, but I see all three being used. Are there cases where the DOM would change such that the more specific scoping actually comes in to play? If so, how would I know what those cases are?


The .workspace class on atom-workspace was used to indicate the workspace, but was deprecated in favor of custom tag name atom-workspace. It’s still there because otherwise a whole lot of packages would break, that were assuming a <div class="workspace">.

Here is a list of other such selectors.