Closed Ramishscrapper closed 9 months ago
This is not compiling
@width: 960px; .nav { width: @width / 3; color: #001 + #abc; } .body { width: 2 * @width / 3; font-family: "hel" + "vetica"; }
it give me this error
fatal error: ParseError: Unexpected input in anonymous-file-0.less on line 8, column 16 .body { width: 2 * @width / 3; font-family: \"hel\" + \"vetica\"; }
That's right. This kind of string concatenation is not supported by the Less standard. If you try the reference implementation in JavaScript, we see much the same error:
Both give the same result:
Parse error: Unrecognised input
Line 8: font-family: "hel" + "vetica";
I suggest using e()
and/or %()
instead. Refer to the docs at https://lesscss.org/functions/#string-functions-e.
Example:
div {
font-family: %("%s%s", "hel", "vetica");
font-family: e(%("%s%s", "hel", "vetica"));
}
div {
font-family: "helvetica";
font-family: helvetica;
}
also getting here in this
.clearfix { display: block; zoom: 1; &:after { content: " "; display: block; font-size: 0; height: 0; clear: both; visibility: hidden; } }
this is the error I get
fatal error: ParseError: Unexpected input in anonymous-file-0.less on line 6, column 14
I'm not able to reproduce this.
$ bin/lessc my-input.less
.clearfix {
display: block;
zoom: 1;
}
.clearfix:after {
content: " ";
display: block;
font-size: 0;
height: 0;
clear: both;
visibility: hidden;
}
Similarly, using the programmatic API:
$ php -a
php > require_once 'vendor/autoload.php';
php > $parser = new Less_Parser();
php > $parser->parse('.clearfix { display: block; zoom: 1; &:after { content: " "; display: block; font-size: 0; height: 0; clear: both; visibility: hidden; }} ');
php > print $parser->getCss();
.clearfix {
display: block;
zoom: 1;
}
.clearfix:after {
content: " ";
display: block;
font-size: 0;
height: 0;
clear: both;
visibility: hidden;
}
This is not compiling
it give me this error
also getting here in this
this is the error I get
this is how I used php