I have a webpage that I am converting into a Joomla template. I am using a LESS file and allowing it to just interpret at runtime rather than compiling it. I see that Joomla has LESS capabilities and even has all the libraries to run LESS. The problem is that no matter where I point the less.js in the it will not work. I even uploaded less.js into the template folder and the default joomla folders and pointed to each location and it still will not work. I do not feel like using a compiler, at least not at this point since I am still messing with the layout and colors and such and that would be an extra few steps that I do not want to deal with right now.

Is it possible to run LESS interpretively on Joomla or is it only allowed through a compiler?

有帮助吗?

解决方案

There is a system plugin which automatically compiles the LESS files on the server if something changed and generates the CSS from it. You then just include the compiled CSS in your template. The plugin is on the JED: http://extensions.joomla.org/extensions/miscellaneous/development/22424

This may fit your needs as well and may be easier in the end.

其他提示

There are a few possibilities here.

  1. If your less.js is not working change the path to absolute path src="http://www.yourdomain.com/js/less.js" instead of "../../js/less.js"

  2. also check the order when loading the scripts you need to load less.js first and then your less file.

Important Note: using less.js or any live interpreter will reduce performance and if user disabled JavaScript your website will have no layout at all.

In case if you changed your mind about compiler there are nice compilers both for windows and mac that automatically updates your css files as soon as you save the less file.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top