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";