-
Notifications
You must be signed in to change notification settings - Fork 195
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
Support logical if() function (Less.js 3.0) #111
Comments
Yes, it's on our roadmap for the 5.x release in our issue tracker at https://phabricator.wikimedia.org/T288498. Would you be interested in helping start the relevant portion from the test/assets/lessjs-3.13.1.js file, or less/less.js#3079? |
Thanks for your reply and it's great to know that a new release is coming to address this. Unfortunately I'm all tied up at the moment so not sure if I could join the testing, but will let you know if I'm available. Regarding the timeframe, do you have any estimated date when the new release is going to be ready? Sorry for being curious. |
@toviet Less.php 5.1.0 should be out within 3-4 weeks, which will release several more Less.js 3.x features. |
This implements the commentStore feature in the Less_Parser. To be able to parse and re-inject comments we need to store them in the commentStore instead of just eating up. In cases where we cannot render comments the commentStore array will be cleaned up. This causes situations when instead of a single argument we might pass the Less_Tree_Exception. As per less.js we introduce the functionCaller (for now just a method instead of additional class) that will clean up Expresssions from comments before calling a function. This fixes the following crash, and more generally preserves comments in various places where we ate them previously. ``` bin/lessc test/Fixtures/lessjs-3.13.1/less/_main/comments2.less ParseError: unmatched `/*` in comments2.less on line 4, column 53 2| @-webkit-keyframes hover /* Safari and Chrome */{ } 3| .bg { 4| background-image: linear-gradient(#333 /*{comment}*/, wikimedia#111); ``` Bug: T353132 Change-Id: I99c42a1969762869023e91deb72f31773b43a06e
Hi,
Is there any plan to support logical function that was added to less.js from version 3.0?
https://lesscss.org/functions/#logical-functions-if
Right now, when my less has an if condition i.e.:
I would get
Unexpected Input
exception when trying to parse the less content.Thanks!
The text was updated successfully, but these errors were encountered: