7 days of WordPress plugins, themes & templates - for free!* Unlimited asset downloads! Start 7-Day Free Trial
  1. Code
  2. JavaScript

Quick Tip: You Need to Check out LESS.js

Scroll to top
Read Time: 1 min

You might be familiar with such services as LESS and Sass. They allow for far more flexibility when creating your stylesheets, including the use of variables, operators, mix-ins, even nested selectors. However, because LESS was originally built with Ruby, a lot of PHP developers, despite the fact that there are PHP versions available, never used it.

Full Screencast

Step 1. Reference LESS.js

Step 2. Import a Stylesheet

Note that we've set the rel attribute to "stylesheet/less" and that our actual stylesheets has an extension of .less, not .css. Also, we must link to this stylesheet before Less.js.

Step 3. Have Fun!

With this minimal amount of work, you now have access to everything from variables to mix-ins. Be sure to watch the four minute video tutorial above for full examples, but here are a few quickies.

It's important to remember that LESS.js isn't finished; hopefully, it will be soon. Nonetheless, it's working wonderfully so far. What do you think?

Did you find this post useful?
Want a weekly email summary?
Subscribe below and we’ll send you a weekly email summary of all new Code tutorials. Never miss out on learning about the next big thing.
Looking for something to help kick start your next project?
Envato Market has a range of items for sale to help get you started.