Book Image

Learning less.js

Book Image

Learning less.js

Overview of this book

Table of Contents (22 chapters)
Learning Less.js
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

The dangers of using Less on the client side


So far, we've worked through how you can install Less in your code and use it to compile code into valid CSS, as each page is displayed.

Surely we should be good to start using Less, right? After all, we have the library in place, we know how to add it in, and know something of what to expect when styles have been compiled...or perhaps not. There is one critical point we've missed; let me explain.

When Less first came out, it was originally written using Ruby; this meant code had to be compiled first, before including the results in website pages, as valid CSS. Although this was a perfectly valid procedure, it made development slower, as extra steps were required in order to compile the Less code and include it in web pages.

The rebasing of the library in JavaScript led to a 30 to 40 percent increase in speed—this led to the temptation to include the library directly in code, along with the raw Less code. This worked well enough, while removing the...