Can't Get Less.Js to Work

Can't get less.js to work

P.S.S. Less.js browser script currently won’t work if you’re using
Chrome and the path to your page starts with “file:///” due to a known
Chrome issue.

But what we could do is setting up a local testing environment using wamp (pc) or mamap (mac). It will work alright then.

Can't get less.js to work

P.S.S. Less.js browser script currently won’t work if you’re using
Chrome and the path to your page starts with “file:///” due to a known
Chrome issue.

But what we could do is setting up a local testing environment using wamp (pc) or mamap (mac). It will work alright then.

less.js not working in chrome

From the link you provided : Less.js browser script currently won’t work if you’re using Chrome and the path to your page starts with “file:///” due to a known Chrome issue.

Less doesn't work on compiled client-side

I think the differences in output you're seeing are due to these compilers using different versions of the LESS spec. Previous versions current versions of LESS (thanks @seven-phases-max) allow variables created in mixins to be used throughout the whole document ('global scope').

You've created the @colorx variable inside of a mixin. To make your code work in a compiler using version 1.4.x, you either need to set your @colorx variable outside the mixin, so it has global scope, or apply the colour to .text by using the mixin.

Here's an example demonstrating variable scope LESS in a compiler (currently) running an older compiler
So I guess you have a couple of options.

Option one, keeping using the old compiler and change your mixin to this:

.setColor(){
@colorx:"yellow";
color: @colorx;
}

.text {
.steColor();
font-size:20px;
}

Or, drop set colour all together, and declare the @colorx:"yellow"; variable in the body of your less file.

Or lastly, as @seven-phases-max has pointed out, your code works in the current versions of the compiler, so you could switch to a more up-to-date compiler and use your code as-is.

LESS.js - Can only import one .less file

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.

LESS.js compiles css but doesn't apply it?

Change the type to text/css and it should work.



Related Topics



Leave a reply



Submit