Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 2 commits into from

Conversation

jamie-pate
Copy link

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

@ricardobeat
Copy link
Contributor

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...

@jamie-pate
Copy link
Author

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
@lukeapage
Copy link
Member

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

@lukeapage
Copy link
Member

I think a variation on this

#823

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

@Synchro
Copy link
Member

Synchro commented Dec 13, 2012

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

@lukeapage
Copy link
Member

Yes... If you are pulling in CSS (either ending in CSS or with query string)

@matthew-dean
Copy link
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.

@matthew-dean
Copy link
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?

@catch-point
Copy link

I think the @include syntax makes the most sense.

@lukeapage
Copy link
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 pushed a commit to CartoDB/carto that referenced this pull request Dec 4, 2014
stefanklug pushed a commit to stefanklug/carto that referenced this pull request Jan 27, 2019
stefanklug pushed a commit to stefanklug/carto that referenced this pull request Jan 27, 2019
stefanklug pushed a commit to stefanklug/carto that referenced this pull request Jan 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants