Repository navigation
Allows root (non-value) functions in Less - #2785
Merged
Merged
Conversation
Member
Author
|
Just as an aside, I discovered from this that creating Less nodes is HARD. That is, there is very little "auto-conversion" of strings to node types, and Less nodes are very granular. So there's certainly still room for improvement on the API side. |
…to root or ruleset
Member
Author
|
@seven-phases-max I probably went overkill on the number of tests I added, but I did one for every node type found in a ruleset root that should produce an error. Take a look and let me know if you think it's safe to merge. |
* master: Make sourcemap generation a bit faster
matthew-dean
added a commit
that referenced
this pull request
Mar 15, 2016
Allows root (non-value) functions in Less
Closed
wmfgerrit
pushed a commit
to wikimedia/less.php
that referenced
this pull request
Nov 2, 2026
The guts of this change is in checkValidNodes. The rest is implementing the new `allowRoot` field in Less_Tree classes, matching less-3.13.1.js (ctrl-F for `.allowRoot =`). ``` $ git grep -F '.allowRoot =' | wc -l 12 # test/assets/less-3.13.1.js $ git grep -F '>allowRoot =' lib/ | wc -l 12 # lib/Less/Tree/*.php ``` Most of this landed in upstream with less/less.js@b67403d3 in less/less.js#2785 which doesn't change behavior but makes internal checks stricter to catch mistakes and syntax errors, none of which we are currently triggering. I also reviewed nearby regions of code for differences with Less.js 3.13 and either: * Port any minor differences now. * Add specific TODOs for bigger changes to port later. * Update `@see` from 2.x to 3.x. Bug: T288498 Change-Id: Ib3e36c99e768540028c640e1a6a8d540288947b6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR greatly increases the utility of
@pluginin the following ways:I've added some additional tests demonstrating custom functions.