News for hackers. Stuff that matters.
Re:CSS coding techniques by jaseflow on Friday May 20, 2016 @05:26AM (#11736515)
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.

Re:CSS coding techniques by Klathmon on Friday May 20, 2016 @06:42AM (#11736809)
In 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.
Re:CSS coding techniques by dcherman on Sunday May 22, 2016 @11:45AM (#11748982)
I'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'.
Re:CSS coding techniques by epmatsw on Friday May 20, 2016 @07:42AM (#11737006)
That 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)?
Re:CSS coding techniques by MrPatan on Friday May 20, 2016 @05:37AM (#11736559)
People who work in a team have a harder time absolutely knowing what's in their team's heads, though.