Like CSS3? Use LESS.jsAugust 23, 2010
I’ve been using Less.js in just about every project I can lately and I freaking love it. I don’t go hog wild about it though; I’d rather preserve the readability and structure of regular ol’ CSS. That said, I do want to make more complex things easier.
But wait, why use it? Well, for a few reasons really, but most importantly to add variables for repeated values like colors and to simplify the usage of CSS3 values that have vendor prefixes.
So here are a few examples of how I use Less.js. Check them out and feel free to use them in your own code.
Comments: Less.js brings a small add-on for me, but for some reason I love it.
Colors as variables: Hex values can be a real headache, especially if you change them often. Use variables instead to save yourself the pain.
Functions: One of my new favorite features is functions in Less.js. I use them on my link hovers. More info
CSS3 mixins: With Less.js, you can use what’s called mixins—partials for your CSS.
Have a suggestion? Talk to me on Twitter or shoot me an email.