4 ms·
I agree. Though, I would love if someone responded and convinced me otherwise. What am I missing?
by mattwdelong 14y ago
I agree. Though, I would love if someone responded and convinced me otherwise. What am I missing?
- shuzchen 14y agoIf 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.
- damoncali 14y agoJust 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?
- arocks 14y agoI 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/ http://www.guardian.co.uk/