0

I have an issue where I can't quite understand why the Less @import option is not working as expected despite trying numerous Less @import options. Here is the file in question (app.less):

@import "theme";
.nav-wrapper--background-white {
    background-color: #ffffff;
}

Initially, when I enter valid Less code in theme.less, the Less compiler does a few things:

1) It generates theme.css. 2) It generates app.less that includes the CSS from theme.css.

This is great. However, if I make subsequent changes in theme.less, the Less compiler regenerates theme.css with the revised changes but, the changes in theme.css are not merged into app.css.

What I am hoping will happen is that whenever I make a change in the referenced theme.less, its theme.css will be included in app.css.

I do this sort of thing in SASS/SCSS and it works as expected. I only started with Less yesterday and assume that the same thing can be achieved. Any pointers would be greatly appreciated.

GazleyGeester
  • 45
  • 1
  • 1
  • 6

1 Answers1

0

This sounds like a problem with your compiler. I'm assuming from your tags that you're using, as what you're describing sounds like expected behavior.

How are you compiling your less?

Jon Roobottom
  • 100
  • 1
  • 8
  • Hello Jon, I'm using what I think is the "official" version of Less as found in the node_modules folder of my UIKit CSS installation. I think this was loaded after running "npm install" as per UIKit installation instructions. The compilation is being triggered by "gulp watch -t hsa" which is monitoring changes in my UIKit theme. I'm new to UIKit and Less so just feeling my way. – GazleyGeester Mar 09 '16 at 10:31
  • This sounds more like a bug in the way UIKit watches for changes in your files and concatenates the files together. Re-reading your original question, one part that doesn't make so much sense is (2). It generates `app.less` or `app.css` ? It may be worth writing your own `gulpfile.js` with the single task of compiling your less to determine if the problem is indeed in UIKit. I've created a quick [example for you here](https://gist.github.com/roobottom/7871827d6ef24d1c3e08) – Jon Roobottom Mar 10 '16 at 09:29
  • Thank you, Jon, for taking the time to create the example file. That's been really helpful. Yes, 2) is my typo - it should have said `app.css`. – GazleyGeester Mar 14 '16 at 18:37