Understanding the power of LESS
In the following sections, we will be organizing, editing, customizing, and creating LESS files in order to generate the desired CSS for our designs.
Note
If you are unfamiliar with LESS and would like to learn more about it, I would recommend the following resources:
LESS documentation at http://lesscss.org/#docs.
A Comprehensive Introduction to LESS from the Sitepoint website, http://www.sitepoint.com/a-comprehensive-introduction-to-less/
In a nutshell, we may say that generating CSS using the LESS preprocessor is an exciting and freeing experience. The key benefits of working with LESS are discussed in the following sections.
Nested rules
Nested rules greatly enhance the efficiency of composing styles. For example, writing selectors in CSS can be highly repetitive:
.navbar-nav { ... } .navbar-nav > li { ... } .navbar-nav > li > a { ... } .navbar-nav > li > a:hover, .navbar-nav > li > a:focus { ... }
This same set of selectors and their styles...