JosephAvestruz
JosephAvestruz

Reputation: 15

Mixin and Implementing on separate Less file

(LESS) Is there a possible WAY that I can use mixin and implementation in two separate LESS file? Wherein I can call on the first LESS file. So that I can only maintain the the second LESS file. Here's my sample but it gives me error.

less1.less:

@complement1: spin(@base_CCS, 180);
@complement2: darken(spin(@base_CCS, 180), 5%);
@lighten1: lighten(@base_CCS, 15%);
@lighten2: lighten(@base_CCS, 30%);

less2.less:

@import "less1";

@base_CCS: #032f6e;
.one   {background-color: @base_CCS;}
.two   {background-color: @complement1;}
.three {background-color: @complement2;}
.four  {background-color: @lighten1;}
.five  {background-color: @lighten2;}

Upvotes: 1

Views: 33

Answers (1)

padarom
padarom

Reputation: 3648

Try to do it the other way around:

less1.less

@import "less2";

@complement1: spin(@base_CCS, 180);
@complement2: darken(spin(@base_CCS, 180), 5%);
@lighten1: lighten(@base_CCS, 15%);
@lighten2: lighten(@base_CCS, 30%);

less2.less

@base_CSS: #032f6e;

That should work from my experience.

Upvotes: 1

Related Questions