LESS - Import Options


Advertisements

In this chapter, we will understand the importance of Import Options in LESS. LESS offers the @import statement that allows the style sheets to import both LESS and CSS style sheets.

The following tables lists the import directives that will be implemented in the import statements.

Sr.No. Import options & Description
1 reference

It uses a LESS file only as reference and will not output it.

2 inline

It enables you to copy your CSS into the output without being processed.

3 less

It will treat the imported file as the regular LESS file, despite whatever may be the file extension.

4 css

It will treat the imported file as the regular CSS file, despite whatever may be the file extension.

5 once

It will import the file only one time.

6 multiple

It will import the file multiple times.

7 optional

It continues compiling even though the file to import is not found.

More than one keyword is allowed to use in the @import statement, however you have to use commas to seperate the keywords.

For instance −

@import (less, optional) "custom.css";
Advertisements