Class Warfare - Can I eliminate CSS classes from my HTML?
shkspr.mobi
shkspr.mobi
textarea { color: red; }
textarea.disabled { color: gray; }
Aiming for full semantic html and applying styles at the tag level _is_ good, but this seems like a not-very-useful refactor which has only made the code more rigid /2c
If a textarea is disabled there's no need to add a class.
textarea {background:red;} textarea[disabled] {background:gray;}
Could also be generalized as: [disabled] {background:gray;} or forms specifically: [disabled]:is(textarea, input, select, button) {background:gray;}