When running with the LESS module enabled (v7.x-2.4), an inappropriate @import link is injected into the head of the document, which fails to resolve.

The URL that shows up in the browser is:
public://less/sites/all/themes/mytheme/css/mytheme.css

With either LESS or LiveCSS turned off, it works fine.

With LiveCSS off, that URL is correct as
http://mywebsite.com/sites/default/files/less/sites/all/themes/mytheme/css/mytheme.css?lzr5vn
which is the autogenerated CSS from the LESS module.

With LESS off (and LiveCSS on), the URL is again correct as:
/sites/all/themes/mytheme/css/mytheme.css.less
which is the original less file.

Comments

guybedford’s picture

Status: Active » Closed (works as designed)

This module isn't actually designed to work with both the LESS module and Live CSS module enabled with LESS support at the same time.

If using the LESS module, you will need to disable live less support in order to use them together.

Typically a workflow might be to use Live CSS during development, then to enable the LESS module and disable Live CSS or the Less support for production.

The issue with the paths is one reported previously as well - so I believe that may be a duplicate.

JoeAndrieu’s picture

Status: Closed (works as designed) » Active

The paths aren't a problem. It's the "public://" URL that's erroneous. The paths work fine as long as just LiveCSS *or* LESS is enabled.

If the functionality is to NOT work with the LESS module, then can we update the project page on Drupal to clarify that? At the moment it says: "To allow LESS parsing to work with CSS compression, use the LESS module (http://drupal.org/project/less), which runs the parsing on the server. The inclusion format of LESS files is the same, so the modules work interchangeably with no need for configuration changes."

To me, that implies you can get CSS compression with LESS when using the LiveCSS module, which apparently isn't at all what you mean. Compatibility would be best, but if we can't get that, could we at least update the description to be clearer?

gaëlg’s picture

Yes, it should be mentioned that if LESS support is enabled in the LiveCSS module configuration, LESS module is useless and even has to be disabled. I tried many things before I finally found this thread.

guybedford’s picture

Status: Active » Closed (fixed)

Sure, I have made this more clear in the module description. Thanks for letting me know.