4 ms·
This would overwrite any other classes as well, which might be fine if you don’t have any but could lead to bugs later on if you forget about this behavior. I
by maddyboo 5y ago
This would overwrite any other classes as well, which might be fine if you don’t have any but could lead to bugs later on if you forget about this behavior.
I don’t really think the point brought up by the other commenters is an issue. If the `no-js` class is missing, that’s a bug. Allowing it to be missing or present makes the behavior hard to reason about: If there is neither a `js` or `no-js` class, what is the desired behavior?
If the elimination of coupling is desired, maybe we should get rid of the `no-js` class altogether and interpret the absence of a `js` class to indicate no js. I think I like this solution best.