News for hackers. Stuff that matters.
Re:Show HN: Hasp – A minimal CSS preprocessor using the M4 m... by cmaher on Thursday August 13, 2015 @11:55AM (#10055115)
> "Tired of all the slow and bloated preprocessors..."

libsass is amazingly fast. I generally see it churn through ~20k lines of CSS (don't ask) in 6ms.

Re:Show HN: Hasp – A minimal CSS preprocessor using the M4 m... by AstroJetson on Thursday August 13, 2015 @12:07PM (#10055211)
Just as I can not rip my bleeding eyes away from Honey Boo Boo, I can't not ask how you got 20K lines of CSS. Families live under the covers of ~5-6K of CSS. Major click bait sites exist with 10-15K of CSS. Help all of us here. You only have 6 lines of HTML and the 20K of CSS does all the work?!? I feel the iterwebtubes are doomed.
Re:Show HN: Hasp – A minimal CSS preprocessor using the M4 m... by ricardobeat on Thursday August 13, 2015 @02:20PM (#10056177)
Look at major websites. You can easily reach 50k to 200k+ lines of CSS in a large project.
Re:Show HN: Hasp – A minimal CSS preprocessor using the M4 m... by djanowski on Thursday August 13, 2015 @12:34PM (#10055403)
It's true. sassc(1) is a great step forward in terms of speed.

That said, Sass encourages practices that I consider bad. Nesting, @extend, etc.

Sass's design also makes it difficult to implement a basic feature like grouping all media queries for a single output. Check this issue from 2011: https://github.com/sass/sass/issues/116

If you don't mind a bigger tool and the dependency on Node.js, then PostCSS looks very good: https://github.com/postcss/postcss

Re:Show HN: Hasp – A minimal CSS preprocessor using the M4 m... by mmastrac on Thursday August 13, 2015 @01:02PM (#10055619)
Why do you consider nesting bad? I'm on the opposite side -- would be interested to hear your thoughts.
Re:Show HN: Hasp – A minimal CSS preprocessor using the M4 m... by djanowski on Thursday August 13, 2015 @02:54PM (#10056397)
Most importantly: it's very easy to end up with a huge CSS file that can't be compressed, and it makes everything more complicated.

Representing hierarchy in the class name makes the output shorter, in most cases, and makes the HTML and CSS code easier to understand. For instance, when you see <div class=title>, you need to go up to find context to understand what that "title" class is. If you have <div class=widget-title>, that's much better. Let alone that generic ("title") classes can lead to problems with conflicting rules depending on their specificity.

By the way, classes at the top level are faster to parse and apply.

This articles expands on some of these issues: http://www.sitepoint.com/beware-selector-nesting-sass