News for hackers. Stuff that matters.
Re:Principles we use to write CSS for modern browsers by MatekCopatek on Thursday September 22, 2016 @10:28AM (#12556997)
Avoiding !important is generally very good advice, although the ZOMG NEVAH! approach is a bit overzealous IMHO.

One good example would be overriding random external styling (e.g. an included CSS file some plugin you use). If their stylesheet has very long and specific selectors, you can either repeat them entirely (#plugin .container .subcontainer .input-wrapper.input-wrapper-blue input[type=text]:first-child) or stay within your general selector-writing practices and use !important instead. I'd argue the latter is a better practice.

Re:Principles we use to write CSS for modern browsers by ulkesh on Thursday September 22, 2016 @10:41AM (#12557083)
I agree with respect to 3rd party libraries. One of the things I hate most about Bootstrap is its amazing overuse of !important.

However, my context was mainly around architecting your own CSS, not as it relates to using someone else's.

Re:Principles we use to write CSS for modern browsers by atomwaffel on Thursday September 22, 2016 @12:31PM (#12558007)
My approach is to slap myself in the face each time I need to use !important. That's enough to prevent me from slipping into bad habits but leaves me with an option if rewriting my CSS to work around somebody else's (or my own) hacks would be more painful than a slap in the face.

I do occasionally get strange looks from my colleagues.

Re:Principles we use to write CSS for modern browsers by talmand on Thursday September 22, 2016 @01:00PM (#12558256)
Just wear a rubber band on your wrist and snap that instead. Your colleagues will just think you're trying to stop smoking.
Re:Principles we use to write CSS for modern browsers by mst on Thursday September 22, 2016 @04:58PM (#12560316)
Or get a pavlok (I have one, it's rather neat, though the bluetooth is predictably terrible).