joomla/joomla-cms — pull request #5267 by okonomiyaki3000 (2014-12-01 05:16:03+00:00)
Title: Less support

Add support for less stylesheets. This is implemented in such a way that you can just use `JHtml::_('stylesheet', 'path/to/stylesheet.less')` and your 'less' stylesheet will be used in debug mode and `less.js` will be loaded. If not in debug mode, Joomla will look for `.min.css` or `.css` in the same directory and use whichever one it finds. `$document->addStylesheet()` also works but does not automatically load `less.js` or search for precompiled/minified css files.

So, for testing:
1) Create a less stylesheet somwhere and a precompiled/minified/appropriately named css file in the same directory.
2) Add `JHtml::_('stylesheet', 'path/to/stylesheet.less')` to your code somewhere.
3) Check what's being loaded when debug mode is on and when it is off.

You should expect that your less stylesheet will be loaded when debug is on and less.js should also be loaded. When debug mode is off, you should see that the `.min.css` or `.css` version is loaded (`.min.css` should take precedence over `.css`).