Reputation: 25557
I have the following file structure:
colors.less
looks like:
@brand-primary-color: orange;
@brand-secondary-color: grey;
I would like to import colors.less
in main.less
, and have the variables used globally throughout the less files.
Creating themes would look something like this:
brand-1.less
@import "themes/brand-1-colors.less"
brqand-2.less
@import "themes/brand-2-colors.less"
brand-3.less
@import "themes/brand-3-colors.less"
[...]
Can't find any way to do this!
The only method that seems to work is to import the colors.less
file within each less sub-file. This makes creating themes a bit tedious...
Any ideas? :) Thanks guys!
Upvotes: 0
Views: 199
Reputation: 111
Presuming main.less
has CSS in it, all you have to do is create a file where you'd import all other less
files. The file structure would look like:
After compiled, the final.css
would be the CSS file containing everything. The final.less
would look like:
@import "main.less";
@import "colors.less";
@import "header.less";
@import "footer.less";
@import "video-player.less";
@import "reset.less";
@import "reset.less";
Last but not least, you should compile only final.less
.
Upvotes: 2