1000 lines of css is still smaller then most images optimized for modern displays (aka everything that isn't a thumbnail). Either our designers don't come up with stuff complex enough to validate adding a compilation step to interpreted code or I'm missing something,

I've been looking into CSS preprocessors. Can anyone give me an example of why you'd use one that isn't some lame programming platitude like "pushing technology forward"? Like an actual design element that can't be done in straight up CSS?

As someone who compiled AS3 for the web back in the day the "new wave" of internet technology (with all it's compilation steps) seems super dodgy.

  • 4
    Considering it translates to css, it obviously can be done in css.

    The biggest argument is reuse and clarity. I'm not really a big fan, but the ability to generate rules in a polyvariant fashion from nested structures without having to explicitly detail each one can be a comparative benefit.

    Many of the benefits of preprocessors have been merged into css itself in recent years, making them less essential.
  • 2
    @SortOfTested Thanks for the example.

    I'm glad you mirror my thoughts about it feeling a little non-essential with modern CSS in mind. I'd rather not add more complexity to the relatively small but agile projects typical for my workplace.
  • 1
    @SortOfTested @OP tl;dr to make up for CSS & browser shortcomings

    I use SASS for breakpoints (think: bootstrap).

    You can't use CSS3 variables in media queries and it will be a cold day in hell before I hard-code my values in CSS so I use SASS to to the ugly work for me.

    Not to mention CSS3 variables still don't have 100% support, so you can't use them in a strict business environment where 100% browser coverage is a goal.

    Since it needs to go through a compilation, there is also some basic error checking as well (though admittedly, it still won't catch almost any typical CSS typos like #botom-banner or .hidee)

    Not to mention SASS isn't held down by politics like CSS is so it can get syntax features more quickly and doesn't have such a high pressure for backwards compatibility.

    The last point in particular has a downside though: SASS may disappear one day, whereas CSS is very likely to be around forever.
  • 1
    @AlgoRythm thanks for that elaborate response. Those are all sound arguments.
Add Comment