Categorías
bookofmatches hookup hotshot

Just How To Make Use Of The LESS CSS Preprocessor For Smarter Style Sheets

Just How To Make Use Of The LESS CSS Preprocessor For Smarter Style Sheets

Installing It

There are two main components to your CSS preprocessor: the language additionally the compiler. The language it self is really what you’re going to be writing. LESS appears the same as CSS, with the exception of a couple of additional features. The compiler is really what turns that LESS rule into standard CSS that an internet web browser can read and process.

A variety of compilers are in fact readily available for LESS, each programmed in a language that is different. There exists a Ruby Gem, a PHP variation, a variation, an OS X application and something written in JavaScript. A few of these are platform-specific, such as the OS X application. With this tutorial, we recommend the JavaScript variation (less.js) given that it’s the simplest to begin with with.

Using the JavaScript compiler is very simple. Simply range from the script in your code, and then it will probably process LESS live as the web page lots. We are able to then consist of our LESS file just like we might a style sheet that is standard. Here is the rule to place between your tags of one’s mark-up:

Keep in mind that I’m referencing the less.js script straight through the Bing Code host. Using this technique, that you do not also need to install the script to utilize it. The design sheet website website link goes over the script to make certain it gets packed and it is prepared for the preprocessor. Additionally, be sure that the href value points to your location of the .less file.