{"id":18448,"date":"2012-09-20T12:46:49","date_gmt":"2012-09-20T19:46:49","guid":{"rendered":"http:\/\/css-tricks.com\/?p=18448"},"modified":"2017-04-13T17:42:04","modified_gmt":"2017-04-14T00:42:04","slug":"using-less-as-a-live-css-engine","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/using-less-as-a-live-css-engine\/","title":{"rendered":"Using LESS as a Live CSS Engine"},"content":{"rendered":"
The following is a guest post by Andrew Powers of PageLines<\/a>. Andrew wrote to me about how they use LESS in their product and how they think it’s better than Sass for what they do. In complete honesty, I still disagree (they are using an unofficial PHP port of LESS, and there is an unofficial PHP port<\/a> of Sass also), but I can’t argue that they way they use it is pretty cool and works for them. This is Andrew explaining that.<\/div>\n

There has been a lot of talk recently about using LESS\/Sass as preprocessors for creating cleaner, cross-browser friendly CSS faster and easier than we could before. And from my own experience I can tell you that once you go to one of these languages, you\u2019ll have so much fun that you won\u2019t be going back to plain CSS.<\/p>\n

The problem with these languages, however, is the word \u2018preprocessor.\u2019 <\/p>\n

The idea of a preprocessor is there is this \u2018processing\u2019 step between the code you write and the code you use on your site. That\u2019s kind of a hassle. Also it prevents us from using variables or functions dynamically, which might be useful if you have users customizing the presentation of your code (like in a WordPress theme).<\/p>\n

Well, live processing LESS in production is very possible, and here is how we\u2019re using it to solve some big problems at our company.<\/p>\n

About PageLines<\/h3>\n

pagelines-loves-less<\/p>\n

PageLines<\/a> makes a \u2018drag and drop\u2019 framework, built on WordPress, intended to make building professional websites easy.<\/p>\n

Trying to keep the professional, yet easy (typical users shouldn\u2019t have to write *any* code), has created a few engineering challenges which LESS has helped solve.<\/p>\n

Use Case<\/h3>\n

The PageLines framework is built on WordPress (in PHP). In considering this solution we had several goals. For example, we wanted to:<\/p>\n