Book Image

Less Web Development Essentials

By : Bass Jobsen
Book Image

Less Web Development Essentials

By: Bass Jobsen

Overview of this book

Less is a CSS preprocessor that essentially improves the functionality of simple CSS with the addition of several features. The book begins by teaching you how Less facilitates the process of web development. You will quickly then move on to actually creating your first layout using Less and compiling your very first Less code. Next, you will learn about variables and mixins and how they will help in building robust CSS code. In addition, you'll learn how to keep your code clean and test it by using style guides. We will then move on to the concept of Bootstrapping and the strength of using Less with Twitter Bootstrap. Going one step further, you will be able to customize Twitter's Bootstrap 3 using Less. Finally, you will learn how to integrate Less into your WordPress themes and explore other web apps that use Less. By leveraging this powerful CSS preprocessor, you will be able to consistently produce amazing web applications while making CSS code development an enjoyable experience.
Table of Contents (15 chapters)
Less Web Development Essentials
About the Author
About the Reviewers

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.

Using the @import...