The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other On Specificity: What's the difference? Reply To: On Specificity: What's the difference?


I had a thought, that I know isn’t original, but it came to me nonetheless.

Setting up a default style for a class, in fact all classes, outside any specificity is a good start. It’s like thinking mobile-first without any JS and then enhance up. So set up CSS with the style defaults (almost assuming they’d be used as a web component) and only use specificity and child/descendant selectors when needed in those very, well, specific instances.

I think this is what the guys I linked to are trying to do, I just don’t like their implementation (and I gather neither do you).

I mainly writing this out because I’ve developed a lot of bad habits over the years with CSS and I’m trying to retrain myself.