SomMeri / less4j

Less language is an extension of css and less4j compiles it into regular css. Less adds several dynamic features into css: variables, expressions, nested rules, and so on. Less was designed to be compatible with css and any correct css file is also correct less file.
145 stars 47 forks source link

Do not support the function #332

Closed small-carbon closed 8 years ago

small-carbon commented 8 years ago

*.less image

Error : image

SomMeri commented 8 years ago

Add (css) into import, like this:

@web-font-path: "https://fonts.googleapis.com/css?family=Source+Sans+pro:300,400,700";

.web-font(@path) {
  @import (css) url("@{path}");
}

.web-font(@web-font-path);

Explanations: when there is no file suffix, less import assumes that you are trying to import less file and therefore tries to load it and parse it. You have to add css option to override it.

Links:

SomMeri commented 8 years ago

Keeping it open, because error message is wrong. It should not show @{path}, but evaluated url("https://fonts.googleapis.com/css?family=Source+Sans+pro:300,400,700") instead.

SomMeri commented 8 years ago

I have investigated some more. Unfortunately, the construction you are using is not supported yet, neither in less4j nor in less.js - see this open issue. I am going to close this issue, because less4j is supposed to behave as closely to less.js as possible. If the issue gets fixed in less.js, I will port the solution here.