When reading about classes and IDs these days, you'd start believing that they were invented exclusively for CSS and JS targeting. To the point where CSS and JS are actually dictating the rules for using classes and IDs. While it's true that CSS and JS are the primary languages that make use of them, they are not the ones laying down the rules. Classes and IDs are part of the HTML and are the HTMLer's responsibility.
The true function of classes and IDs is to open up the HTML to a variety of interested parties. Classes and IDs are hooks that other languages use to find what they need. Classes and IDs may not need semantic, but thinking of them as semantic abstractions makes it a lot easier for a HTMLer to IDentify what classes and IDs are needed to make the code accessible to all. A class like .fancyHeading is not a valID class under normal circumstances. It's a CSS-specific class that no other interested party would benefit from and only solves a problem that could've been better solved using CSS preprocessors.
The problem is that lack of HTML consistency is preventing other languages from actively querying our HTML code, so the dominance of CSS and JS remains. Forgoing the wealth of opportunities here and focusing on CSS and JS just further diminishes the power of classes and IDs. So let's stop messing up our HTML with language-specific classnames and IDs, instead focusing on drawing up HTML components and leaving the responsibility to deal with them in each respective language.