4 ms·
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
by shuzchen 14y ago
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.
- 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?