Skip to content

Try our new Crash Courses!

Buy one of our new Crash Courses, now hosted on Teachable.

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