Importing CSS into Less
As you already know now, valid CSS is also valid Less code. CSS code can be imported into Less. There are different ways to do this. After importing your CSS, you can run the result through the compiler. This offers you an easy way to start using Less in your current project.
Consider creating a style guide before starting to import your CSS code. Style guides help you test your code, as described in Chapter 4, Avoid Reinventing the Wheel. Also, remember that Less is a
CSS preprocessor. This means you have to compile your Less code into CSS before taking it into production. Client-side compiling with less.js
should only be used for test purposes! Only importing your CSS and compiling it back into CSS again makes no sense. After importing, you should start improving your code. Importing CSS also offers the opportunity to combine the pre-existing CSS with newly written Less code and allows you to do the conversion to Less iteratively and gradually.