J
J
John Gault2015-05-15 19:30:45
Less
John Gault, 2015-05-15 19:30:45

Compiling LESS via less.js?

Good afternoon. There is a problem compiling the LESS file. In fact, it doesn't compile at all. As with the million tutorials I've found on the subject, I include the main.less stylesheet first, and then the core less.js. In theory, that's it, compilation should be performed on the client side in the browser. But for some reason nothing happens to me. And oh gods, I will be happy if someone tells me what I did wrong or what I did not do. So, it compiles only locally - through WinLess (I have not tried other compilers), but I need the option above. Thanks a lot to everyone in advance.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Pavel Radkov, 2015-05-15
@paulradzkov

If your file is opened using the file:// protocol (just opened the file from the explorer), then LESS.js will not compile in this way. LESS.js wants an HTTP server.
How to raise an HTTP server from any folder:
Now LESS will be compiled on the client.

Z
zooks, 2015-05-15
@zooks

Compilation should NOT be done on the client side via less.js. The client receives the finished CSS.
To do this, you need to install node.js. And then Less itself with the command:
npm install -g less

D
Denis Malinochkin, 2015-05-15
@DiAsCrafts

Try the option described here: Less. A Beginner's Guide
Here are the example files: click .
It was launched from Brackets, but it is possible to use the method described by Pavel or XAMPP.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question