Live CSS is working perfectly for normal css files. However, when I enable support for less files, and add a global.less file in my theme.info file, the live_css path to the file seems to get confused.
Path to css files looks like this....
http://mydomain.com/drupalbase/sites/all/themes/mytheme/css/main.css
WORKING
But less is looking for...
http://mydomain.com/sites/all/themes/mytheme/css/global.less
It is skipping the "drupalbase" sub directory of my drupal install.
I think line 204 of live_css.module is the problem...
$path = $_SERVER['DOCUMENT_ROOT'] . '/' . $path;
Do we need to use drupal_base() instead of DOCUMENT_ROOT ? We just need a way of picking up sub directories.
I guess it's because .less files get treated as external files....
if (drupal_substr($input_file, -5) == '.less') {
$styles['#items'][$key]['type'] = 'external';
}
And my dir structure does not represent the external address.... for example.
Local path = ~/myhome/drupal/drupalbase/sites/all/themes/css
/var/www/drupalbase = Symbolic link to drupalbase dir above
External Path = i.p.address/drupalbase/index.php
Perhaps my set up is a bit unusual, but this is quite common on local development installs too.
It would be nice if this great module worked for all directory set ups.
If it can't be fixed, perhaps just add a comment in the LESS setting to say that .less files will only work if drupal is the basedir of the document root url.
Comments
Comment #1
corey.aufang commentedThis sounds like an issue for Live CSS, moving...
Comment #2
guybedford commentedThanks for finding the subpath issue. This can certainly be fixed.
I'm away on holiday till later this month, and will get to it then. If you need a fix sooner, perhaps play around with the drupal_base() function here. There is some path manipulation in the other included js file in the module as well that may need adjustment too.
Otherwise, I will certainly get to it later.
Comment #3
medden commentedThanks @guybedford. No real rush for this, as I know it works if I use a proper path for my site.
Enjoy your Holiday!
Comment #4
guybedford commentedComment #5
guybedford commentedI'm still trying to track down exactly where your path issue is.
Can you tell me does the live editing work at all? Or do you just get this issue on saving?
I'm thinking this isn't an issue with the document root, it looks like it's actually an issue with the less paths.
If the problem is with editing, it may work to change line 7 of less-display.js from:
href = '/' + href;
to:
href = '/drupalbase/' + href;
Would appreciate more info here. Thanks.
Comment #6
guybedford commentedComment #6.0
guybedford commentedupdated some words