0

I am importing a less file inside Mixins but it is not compiled into the output. I am running command as lessc client.less > client.css. Below is my code.

client.less:

@color: #000;

@import "theme.less";

@import "dark-theme.less";

.themeDefs(1);

theme.less:

body {
   color: @color;
}

dark-theme.less:

.themeDefs(1) {
   @color: #fff;

   .darkTheme {
      @import "theme.less";
   }
}

Output:

body {
   color: #000;
}

Expected Output:

body {
   color: #000;
}

.darkTheme body {
   color: #fff;
}
Abraham Gnanasingh
  • 837
  • 2
  • 10
  • 31

1 Answers1

0

By referring this link, I am able to achieve this by using loop in less css.

Abraham Gnanasingh
  • 837
  • 2
  • 10
  • 31
  • If you think this is a duplicate Question, please flag it to be closed as a duplicate. If not add context to any links so your answer is self contained, see ["Provide context for links"](https://stackoverflow.com/help/how-to-answer). – Scratte Apr 25 '20 at 12:13