The genCss method of ruleset.js splits child nodes into two groups:
* rules,
* rulesets.
Rules are always printed first and have special handling for last rule.
Rulesets are always printed second. Wrong ordering was caused by the
condition that determined what is rule and what is ruleset.
Issue #2013: The condition made no difference between @charset and @page,
because both are compiled into tree.Directive nodes. I added isRulesetLike
method to the tree.Directive to differentiate between them.
Issue #1954: The condition treated all tree.Anonymous types as rules and
caused them to float up. That is incorrect, because `@import (inline)` is
compiled into tree.Anonymous too, but should be treated as ruleset and
stay where it is.
First step in implementing syntax for @import options, proposed in
https://github.com/cloudhead/less.js/issues/1185#issuecomment-13710620
(steps (1) and (2)).
I've implemented the 'multiple' and 'less' options. One could trivially
add 'once' and 'css' options as well, if there was need. Proposed
"silent" and "inline" options are deferred for future work.
I left the existing "@import-multiple" and "@import-once" syntax in place,
although the proposal is for this to be deprecated once the new option
syntax is in place.
It is up to the parser and compiler to rewrite them when those files are
imported by another LESS file.
- Modified and added test cases for import and import-once rules
- Fixed difference between client side and server side handling of relative urls
- Added a -rootpath option to lessc to specify another base path for the url
rewriting. By default, rootpath=''