darylknight
darylknight

Reputation: 250

LESS.js - Can only import one .less file

I've been trying to split my less files up in to sections to make them easier to navigate, and want to import them all using one main file to compile them to css. my style.less file looks like this:

@import "reset";
@import "colors";
@import "grid";
@import "functions";
@import "headings";
@import "listings";
@import "content";
@import "buttons";
@import "layout";
@import "forms";

I'm using Winless to compile, and it says "Successfull Compile", but the resulting css file is completely blank. When I change my style.less file to only have one import, it imports that file no problem, so I know it's not a file directory/permissions problem. Any ideas? This is driving me mad. I love LESS, I don't want to have to do everything in one sheet.

I'm on a PC. Don't seem to have any trouble doing this at work on OSX, but I use Windows 7 at home and need something like Winless. I get the same results using less.js client side javascript file.

Upvotes: 1

Views: 1566

Answers (3)

DevWL
DevWL

Reputation: 18840

This is an old issue and it now works fine with less.js in v2.5.3.

@import "reset.less";
@import "grid.less";
@import "color.less";
@import "custom.less";

CDN reference below:

<script src="//cdnjs.cloudflare.com/ajax/libs/less.js/2.5.3/less.min.js"></script>

Just remember to put your:

<link rel="stylesheet/less" type="text/css" href="less/compiled.less"/>

before the less.js reference.

Upvotes: 1

Kevin Lewis
Kevin Lewis

Reputation: 1085

Using less.js has given me issues. Like darylknight, I suggest an alternative. I present upon to thee WinLess

Upvotes: 0

darylknight
darylknight

Reputation: 250

I think this was due to a bug in LESS.js, and has since been fixed. Additionally, I've now moved to SimpLESS on Windows, and CodeKit on OSX. Neither of these have the same issues.

Upvotes: 0

Related Questions