allow processing of .less.css in addition to .less files #315

wants to merge 2 commits into

6 participants


allow *.less.css files to be processed in addition to *.less files
in case a webserver refuses to serve *.less files


This doesn't sound right to me on three levels:

  1. I don't think LESS should encourage using wrong file extensions, LESS files are not CSS.
  2. It's not that hard to configure a server for serving .less files properly
  3. .less shouldn't be deployed to live servers anyway...

ah, but .less.css files are not css files either.
Not everyone has control over their hosting solution (or in cases like mine the person who does charges $100/h to fix stuff like this)

@jamie-pate jamie-pate closed this Jul 13, 2011
@jamie-pate jamie-pate reopened this Jul 13, 2011
Less member

@matthewdl @Synchro are you happy for this to be closed?

Less member

I think a variation on this


should be pulled instead (but with a different option name)

Less member

It hadn't occurred to me that import didn't work like that already! Does it need to enforce file names anyway?

Less member
Less member

Several people have asked for variations of this. Flagging files with .CSS extensions (or other extensions, like .aspx) to be imported, interpreted, and compiled as LESS seems okay, since there can be legitimate server limitations with naming a file .less. Rather than try to solve all those server abnormalities, an author should be able to say to the parser, "Look, this IS really a LESS file." I agree that simply naming .less.css doesn't sufficiently cover it. Something like #less on the URL or something like that could be used for force less import.

Less member

@Synchro Alexis's (@cloudhead) idea was to use the same CSS syntax for LESS import, and essentially "smart-switch" the behavior of importing. If it ended in CSS, preserve the @import call as is (because, of course, there are many cases where you want the @import to continue to exist). If it ends in .LESS, then feed it into the parser chain. It works in 99% of cases. It's these edge cases that might become difficult for devs.

One alternative to futzing with URLs is to create a duplicate syntax for LESS imports. In fact, I was about to mention @include as a way to force LESS importing, and then figured it might have been suggested....

Yep: Issue #560. I shot it down, but it's probably an even simpler and more straightforward syntax then appending a bunch of characters to your URL.

So, you could do:

@include url(imreallyalessfile.css);  /* interpret this sucker as LESS */

To me, that may be cleaner than stuff like this:

@import url(imreallyalessfile.css?noreally=imlesssrslyuguys);

The second option is how the solution in #823 reads to me. Thoughts?


I think the @include syntax makes the most sense.

Less member

yes. So all agreed that we close #823 and close this one, and proceed with #560.. ?

@lukeapage lukeapage closed this Dec 16, 2012
@javisantana javisantana pushed a commit to CartoDB/carto that referenced this pull request Dec 4, 2014
@springmeyer springmeyer add testcase for #315 if I'm understanding right should produce no ou…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment