Can't get less.js to work

I can't get less.js to work and I have no idea why. Heres the HTML i tried:

<!DOCTYPE HTML> <html lang="en"> <head> <meta charset="utf-8" /> <!-- CSS --> <link rel="stylesheet/less" href="main.less" /> <!-- Javascript --> <!-- <script src="http://lesscss.googlecode.com/files/less-1.0.18.min.js"></script> --> <script src="less-1.0.18.min.js" type="text/javascript"></script> </head> <body> <p> Lorum ipsum </p> </body> </html>

And heres main.less:

p { color: blue; }

The less-1.0.18.min.js file is downloaded from http://lesscss.googlecode.com/files/less-1.0.18.min.js. All files is in the same folder. I have no idea why this isn't working...

Tested in Chrome 12.0.742.100

Edit

Tried the lates less.js file (less-1.1.3.min.js). That one did also not work.

Okay now...

This works:

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

But only as normal css, no less specific markup.

This doesn't work at all:

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

Also, this isn't working:

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

What the hell? How do I get less to work?

Found the error

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.

Soruce

-------------Problems Reply------------

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.

You can use the command-line switch -allow-file-access-from-files when starting chrome - it will permit less.js to access local less files.

Even though this was posted a while ago I thought I would add a little something for other people stuck on this.

If you use a windows machine, you might want to give WinLess a try. Its a pre-compiler for windows. Seems straight forward to use. Good luck. http://winless.org/

I recommend you to use a compiled vesion of the LESS file. You can do this for example in windows with WinLess or SimpLESS.

I'm using winless. It automatically compiles my .css files when I save my code.

I don't see it as being a good idea to have your styles be dependent on less.js. Why not use a compiler like less.app and just link to the compiled css file. That way you get the benefit of writing less, without the drawback of javascript dependency.

Need to add

type="text/css"

to your css link.

Category:css Views:0 Time:2011-06-16
Tags: css less

Related post

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.150 (s). 11 q(s)