News for hackers. Stuff that matters.
Re:How We Could Write Better CSS by pothibo on Tuesday September 24, 2013 @01:23PM (#6439304)
Nice article! One more important reason why to use class instead of tags: CSS rules are read from right to left. That means the browser will first gather all the h[1-6] and then it will filter the headers down with the other rules from there.

If your CSS rules are applied to classes, it will gather the classes first then filter it down (Resulting in a smaller set in the first place).

CSS processing will be much faster.

Re:How We Could Write Better CSS by sriharis on Tuesday September 24, 2013 @01:26PM (#6439331)
That is so true. Github had a lot of performance issues in their diff pages and they solved by using one-to-one mapping class-names and keeping the specificity as low as possible. Here's more on that: https://speakerdeck.com/jonrohan/githubs-css-performance?sli...