Reputation: 32331
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?
Upvotes: 14
Views: 10726
Reputation: 191
Include less file in your html and use some server if u r using google chrome.
Upvotes: 2
Reputation: 12427
you have to use some web server like apache tomcat, uniform server UPX etc in order to compile less in IE. as @ie told include those files in your document before running it in localhost.
Upvotes: 1
Reputation: 8123
Check your web server. Many servers are not initially set up to handle serving LESS files. Specifically newer versions of IIS tend to block serving *.less
and need to be configured to do so. You can see if this is happening by loading your LESS CSS file directly from your browser. The easiest way to do that from Firefox is to view your page source and click the link to your LESS file.
Upvotes: 0
Reputation: 6101
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:
link
tag before script
tagrel
to “stylesheet/less”
Upvotes: 15