3 ms·
I like most of these except the one about not using !important. I use .flat { margin-bottom: 0 !important } to remove the default bottom margin from certain ty
by jaseflow 10y ago
I like most of these except the one about not using !important.
I use .flat { margin-bottom: 0 !important } to remove the default bottom margin from certain typographical elements (ie. h1,p,ul). In this case where I absolutely know that I mean what I say when I apply that class, it works great.
- MrPatan 10y agoPeople who work in a team have a harder time absolutely knowing what's in their team's heads, though.
- Klathmon 10y agoIn the future, try using: .flat.flat.flat.flat { margin-bottom: 0; } It gives you the specificity to override most things, and still leaves you the "nuclear option" of `!important` if you ever need it.
- epmatsw 10y agoThat seems frighteningly unclear. If you do need the "nuclear" option, why not have that be the case where you get into weird specificity hacks (flat.flat !important /hack/) and leave the common style clear in its intention (.flat !important)?
- dcherman 10y agoI'd rather see !important instead of this. This rule would call for quite a lengthy comment explaining just what in the hell the repeated .flat rules are for, and what other rules it's attempting to pave over such that you know when you need to add a 5th .flat as a "fix'.