Comments (2)
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:
- http://ecomfe.github.io/est/fiddle/#version=2.5.3&autoprefix=false&est=false&autorun=false (reference version Less.js 2.5.3, matching Less.php)
- http://ecomfe.github.io/est/fiddle/#version=3.8.1&autoprefix=false&est=false&autorun=false (latest)
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;
}
from less.php.
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;
}
from less.php.
Related Issues (20)
- PHP 8.2 Creation of dynamic property warning HOT 2
- Tree_Javascript or Tree_JavaScript? HOT 6
- Allowed memory limit exceeded when unserializing cache. HOT 4
- Support `@property` rule (Less.js 3.x)
- Block comments in @font-face are moved to bottom of selector HOT 3
- Regression in v4.2.0 HOT 6
- Regression: CSS output differs from Less.js for mixin selector HOT 3
- Undefined array key "currentUri" in [...]Mapped.php Line 68 when using @import (inline) HOT 1
- Support each() function (Less.js 3.7.0) HOT 4
- Release v3.2.0 HOT 2
- PHP v5.6-7.0 deprecation HOT 1
- Cannot assign em or rem value to less variable. HOT 2
- Support @container queries (Less.js 4.2.0) HOT 1
- Import from google font HOT 3
- Deprecation warning in PHP 8.2 HOT 6
- if $cached_name is the same as the $compiled name, should not regenerate HOT 1
- @container queries support? HOT 2
- Support CSS4 space-separated syntax for rgba() function (Less.js 3.8.1) HOT 1
- Autoloading can fail due to incorrect class name casing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from less.php.