We've just gone though our codebase to enforce using CSS.escape on any dynamic parts of a selector. The only caveat we've found so far is with :nth-child and friends, due to the very limited set of parsing of An+b
// Works fine
querySelector(`div.${CSS.escape(3)}`);
// Throws parse error
querySelector(`div:nth-child(${CSS.escape(3)})`);
Is CSS.escape meant to handle this situation? Or, should the An+b syntax be loosened to allow escaped numbers?