Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I compile LESS files within browser

Tags:

less

I created code for switching themes using LESS functionality. Unfortunately the LESS files will not compile in browser. How can I compile LESS files within browser?

like image 746
Pawan Avatar asked May 11 '12 15:05

Pawan


2 Answers

This is a piece of documentation:

Client-side usage

Link your .less stylesheets with the rel set to “stylesheet/less”:

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

Then download less.js from the top of the page, and include it in the <head> element of your page, like so:

<script src="less.js" type="text/javascript"></script>

Make sure you include your stylesheets before the script.

So, you need to:

  1. place link tag before script tag
  2. set rel to “stylesheet/less”
  3. be aware of bug in chrome
like image 196
ie. Avatar answered Oct 19 '22 02:10

ie.


Include less file in your html and use some server if u r using google chrome.

like image 2
user2327502 Avatar answered Oct 19 '22 03:10

user2327502