Processing Less CSS files that have php tags -
we have less file hi_style.less
:
@import "css/base-ui.less"; #hi { margin: 100px; }
that includes less file css/base-ui.less
lines this:
.ui-go { background: #74a372 url(<?php echo $l_uri; ?>/images/ui-go.png) repeat-x scroll 50% 50%; }
the reason need php (unless has better idea) because there 1 codebase have many sites attached separate database singular codebase.
e.g.
site-a.mysite.com
, site-b.mysite.com
both use same code urls different.
is there way ignore php tags in less or better way have explicit urls 1 codebase.
we can't use relative paths base path can change , point different codebase.
thanks in advance.
edit: can't static file after it's processed because codebases can accessed via url like: site-a.mysite.com/testing
or site-a.mysite.com/beta
url of image file be:
http://site-a.mysite.com/images/ui-go.png
or
http://site-a.mysite.com/testing/images/ui-go.png
or
http://site-a.mysite.com/beta/images/ui-go.png
depending upon codebase that's being accessed.
it seems me wrapping url
string in quote marks (which quite valid; here did single quotes '
) solve issue. so...
.ui-go { background: #74a372 url('<?php echo $l_uri; ?>/images/ui-go.png') repeat-x scroll 50% 50%; }
that allows less output string php code (rather throw error), when run compiled css through php parser (i assume doing), should still fill in echo
value needed.
Comments
Post a Comment