News for hackers. Stuff that matters.
Re:I can style a whole app with only four hex values and SASS. by mattwdelong on Wednesday May 02, 2012 @11:45PM (#3922297)
I agree. Though, I would love if someone responded and convinced me otherwise. What am I missing?
Re:I can style a whole app with only four hex values and SASS. by shuzchen on Thursday May 03, 2012 @02:35AM (#3922664)
If you've ever had to go back to your CSS and redo the colors (client wanted red instead of blue) then you'll find yourself thinking "I wish I could just store these redundant values in one place". At that point you'll start looking at css preprocessors. A simple find/replace doesn't always cut it (I want these things red, keep these other things blue), especially if your design also has derivative values (used in gradients, shadows).

Personally, while I do try to take advantage of all the features of LESS, I think the biggest thing is the ability to define macros (utilizing mixins or functions). Never again do I need to write multiple rules for one style (-moz-foo, -webkit-foo, and foo) or need to remember the complicated argument order (defining gradients is vastly different between all of them).

The cost is in introducing a compile step, but the benefit is that your stylesheet becomes easy to write, easy to read, easy to modify.

Re:I can style a whole app with only four hex values and SASS. by damoncali on Thursday May 03, 2012 @10:36AM (#3924003)
Just curious - is there a reason CSS can't incorporate variables/macros and basic math without having to resort to a preprocessor? When CSS 5 or whatever is released, will all of this just be known as CSS?
Re:I can style a whole app with only four hex values and SASS. by arocks on Thursday May 03, 2012 @03:19AM (#3922757)
I think SASS is great for reusing pages or styles within or across projects. If a website has color-coded areas, say like The Guardian[1], then using color variables as the OP mentioned would make it extremely trivial to reuse.

The math behind layouts can also be set using variables reducing a lot of headaches while the client wants 'the left column could be a bit wider'.

I agree that it requires a lot more coding discipline than plain 'ol CSS. So much to the extent that one would be tempted to abandon it. But like all good layers of abstractions, it reduces a lot of effort in the future.

[1]: http://www.guardian.co.uk/