3 ms·
Why can't people just not go out of their way to write crap CSS in the first place? There seems to be this trend to show off all the possible different ways yo
by DonHopkins 9y ago
Why can't people just not go out of their way to write crap CSS in the first place?
There seems to be this trend to show off all the possible different ways you know of addressing a single element somewhere, by pointlessly combining them together in brittle ways that depend on each other and accidental document structure, using haphazard random inconsistent naming conventions.
If there's only one of them, then use a fucking id.
- Cozumel 9y ago^this. If people took the time to learn the basics then this whole thing wouldn't even be an issue.
- breeny592 9y agoContext: I work on a large CMS powered site We have a company wide rule of no IDs in styles - we actually lint for them. As a front end team, we can't be certain that there will only ever be one of a component on a page at a time. Sometimes we can be mostly certain, but the content authors can theoretically do anything, and our job is to provide them flexibility whilst keeping the site looking good. Modular CSS would be a God send for us, would be able to handle a lot of things much cleaner but sadly the current build of the CMS doesn't allow for it. In small sites, or anything with static content, IDs are more than valid. But it becomes a lot harder when dynamic content, especially dynamic components, come into play.