As we were figuring out how to handle T312594, which required style changes in both Codex and Vector, @Jdlrobson suggested we add a class to the <html> element specific to the current version of Codex (e.g. codex-v-[version]). That way, applications could write styles that target a specific version, avoiding breaking changes like the ones introduced in this particular case.
We'd like to explore this idea, and implement the solution inside MediaWiki if possible. The codex package could export a VERSION variable, and MediaWIki could grab that version number and add the CSS class.