Frontend department at our company is growing fast, people are working in small teams, but our CSS/HTML is still a mess. I decided to organize a small workshop and present some basic rules: html5 elements, no greedy selectors, no ids, extensibility, flexibility and so on.<p>The question is how to enforce those rules without getting rejection and hate from other developers?
Instead of enforcing them and making it a top-down decision, make it a discussion where everyone has input. If the CSS/HTML is really a mess, then everyone probably knows it and has to work with it every day.<p>See if you can come up with an estimate for how much of a time suck the bad practices actually create, and how much extra time it would take for people to actually do it correctly the first time.
If you put it to them as "You can spend 10 minutes now, or an hour later when you come back later and have no idea what's going on", they'll probably be a bit more receptive.<p>Come in with a set of standards - then ask for objections / suggestions and make it a collaborative effort. Be prepared to defend your choices, and allow others to defend theirs as well.<p>Is there anything like checkstyle for HTML? (I work in Java, and our team uses it to enforce style guidelines) The easier it is for people to follow the rules, the more likely they are to actually do so.