Add flag to treat @import URLs as opaque #823

wants to merge 1 commit into


None yet

3 participants

jamesrdf commented Jun 4, 2012

Not every @import URL will end in .css or .less, some may include a query string to generate the CSS or LESS dynamically. This patch adds an "opaque" boolean flag to the less.Parser parameter and if true will cause all import URLs to be the same: never append ".less" and always inline the style rules.

Some example @import would be:
@import url("style.cgi?lang=en");
@import url("style.cgi?format=lesscss");


I'm not sure if opaque is a good option name..
also this is only an issue for less.js in the browser right?
also you could add &dummy=.less on to the end to get around this issue?

jamesrdf commented Aug 5, 2012

I am using less.js on server side and want to combine all less and css files into one.

The &dummy=.less is a workaround, but requires editing all @import rules, which is not desirable in my situation.


There may be a more elegant solution. See the thread at the bottom of issue #315.

@lukeapage lukeapage closed this Dec 16, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment