Skip to content

Try our new Crash Courses!

Become a member using the button below to hide this banner and gain access to our new Crash Courses.

Importing – Less

Summary

To import a partial into another Less file, use the following syntax at the top of your file:

@import 'colors.less';

Details

You can split up your Less code into multiple files and still have one CSS file in the end using partials and imports.

The partial file will not be compiled into its own CSS file. Instead, to use the code you import it into a normal Less file that will be compiled.

Exercises

Try importing the file colors.less into main.less using the following line:

@import 'colors.less';
Back to: Less Reference