In the guide you mention that JS should only touch data attributes or classes starting with .js- and that:
You shouldn't style those classes: they are to be used for Javascript purposes only.
When this interaction is simply a way for JS to handle some sort of JS-only state then I agree completely 😄
What if the state change means that the element should be styled differently however? How do you propose handling that?
In the guide you mention that JS should only touch data attributes or classes starting with
.js-and that:When this interaction is simply a way for JS to handle some sort of JS-only state then I agree completely 😄
What if the state change means that the element should be styled differently however? How do you propose handling that?