-
Book Overview & Buying
-
Table Of Contents
LESS WEB DEVELOPMENT COOKBOOK
By :
You will know already that the @import directive in CSS can be used to import other CSS files into your CSS code. In Less, you can use the @import directive to import the Less code from other files. The @import directive enables you to spread your Less code over more than one file, which gives you the opportunity to build a logical and easy-to-maintain structure of Less files.
In this recipe, you will create a main project file that will import your other project files. You need to create the following files and directories:

You can edit the Less files with your favorite text editor and use the command-line lessc compiler, as described in the Installing the lessc compiler with npm recipe in Chapter 1, Getting to Grips with the Basics of Less, to compile the project.less file.
Start with editing the project.less file and write the following content into it:
@import "variables.less"; @import (reference) "mixins.less"; @import...
Change the font size
Change margin width
Change background colour