less 2.1.1 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/inspectionProfiles/Project_Default.xml +1 -0
- package/.idea/jsLinters/jscs.xml +4 -0
- package/.idea/jsLinters/jshint.xml +58 -4
- package/.idea/workspace.xml +451 -758
- package/.jscsrc +38 -0
- package/.jshintrc +0 -2
- package/.travis.yml +0 -1
- package/CHANGELOG.md +52 -0
- package/Gruntfile.js +37 -3
- package/bin/lessc +380 -316
- package/bower.json +1 -1
- package/dist/less.js +790 -479
- package/dist/less.min.js +7 -7
- package/lib/less/contexts.js +1 -1
- package/lib/less/data/unit-conversions.js +3 -3
- package/lib/less/environment/abstract-file-manager.js +4 -4
- package/lib/less/environment/environment.js +9 -0
- package/lib/less/functions/color-blending.js +3 -3
- package/lib/less/functions/color.js +8 -8
- package/lib/less/functions/data-uri.js +39 -31
- package/lib/less/functions/string.js +3 -1
- package/lib/less/functions/svg.js +12 -15
- package/lib/less/functions/types.js +15 -2
- package/lib/less/import-manager.js +10 -5
- package/lib/less/index.js +2 -1
- package/lib/less/parse-tree.js +8 -2
- package/lib/less/parse.js +65 -0
- package/lib/less/parser/parser-input.js +3 -2
- package/lib/less/parser/parser.js +24 -11
- package/lib/less/render.js +7 -36
- package/lib/less/source-map-output.js +3 -3
- package/lib/less/transform-tree.js +1 -1
- package/lib/less/tree/assignment.js +0 -1
- package/lib/less/tree/color.js +4 -4
- package/lib/less/tree/condition.js +1 -1
- package/lib/less/tree/debug-info.js +6 -2
- package/lib/less/tree/dimension.js +1 -1
- package/lib/less/tree/directive.js +25 -6
- package/lib/less/tree/expression.js +1 -1
- package/lib/less/tree/import.js +2 -2
- package/lib/less/tree/index.js +1 -0
- package/lib/less/tree/media.js +3 -2
- package/lib/less/tree/mixin-call.js +3 -4
- package/lib/less/tree/mixin-definition.js +4 -3
- package/lib/less/tree/quoted.js +1 -1
- package/lib/less/tree/rule.js +2 -3
- package/lib/less/tree/ruleset.js +263 -157
- package/lib/less/tree/selector.js +2 -1
- package/lib/less/tree/url.js +5 -2
- package/lib/less/tree/value.js +1 -1
- package/lib/less/tree/variable.js +1 -1
- package/lib/less/visitors/extend-visitor.js +60 -25
- package/lib/less/visitors/import-sequencer.js +20 -14
- package/lib/less/visitors/import-visitor.js +13 -10
- package/lib/less/visitors/to-css-visitor.js +37 -5
- package/lib/less-browser/add-default-options.js +5 -1
- package/lib/less-browser/bootstrap.js +10 -8
- package/lib/less-browser/cache.js +1 -1
- package/lib/less-browser/index.js +13 -12
- package/lib/less-browser/utils.js +9 -6
- package/lib/less-node/file-manager.js +51 -28
- package/lib/less-node/image-size.js +34 -0
- package/lib/less-node/index.js +3 -0
- package/lib/less-node/lessc-helper.js +3 -2
- package/lib/less-node/url-file-manager.js +2 -2
- package/lib/less-rhino/index.js +2 -4
- package/package.json +10 -7
- package/test/browser/common.js +13 -11
- package/test/browser/css/urls.css +6 -3
- package/test/browser/jasmine-jsreporter.js +2 -3
- package/test/browser/less/nested-gradient-with-svg-gradient/mixin-consumer.less +5 -0
- package/test/browser/less/nested-gradient-with-svg-gradient/svg-gradient-mixin.less +15 -0
- package/test/browser/less/urls.less +1 -0
- package/test/browser/less.js +15 -9424
- package/test/browser/runner-errors-options.js +0 -1
- package/test/browser/runner-errors-spec.js +0 -1
- package/test/browser/runner-legacy-options.js +0 -1
- package/test/browser/runner-no-js-errors-spec.js +0 -1
- package/test/browser/runner-production-options.js +0 -1
- package/test/browser/runner-relative-urls-options.js +0 -1
- package/test/browser/runner-rootpath-options.js +0 -1
- package/test/browser/runner-rootpath-relative-options.js +0 -1
- package/test/browser/runner-strict-units-options.js +0 -1
- package/test/copy-bom.js +72 -0
- package/test/css/comments.css +1 -0
- package/test/css/css-3.css +2 -0
- package/test/css/functions.css +2 -0
- package/test/css/import-interpolation.css +6 -0
- package/test/css/import-reference.css +25 -0
- package/test/css/include-path/include-path.css +6 -0
- package/test/css/mixins-important.css +6 -0
- package/test/css/selectors.css +10 -1
- package/test/css/url-args/urls.css +3 -3
- package/test/css/urls.css +12 -4
- package/test/css/variables.css +7 -1
- package/test/data/image.svg +3 -0
- package/test/index.js +14 -10
- package/test/less/comments.less +1 -0
- package/test/less/css-3.less +3 -0
- package/test/less/css-guards.less +2 -1
- package/test/less/errors/detached-ruleset-2.txt +1 -1
- package/test/less/errors/import-missing.txt +1 -1
- package/test/less/errors/parens-error-1.txt +1 -1
- package/test/less/errors/parens-error-2.txt +1 -1
- package/test/less/errors/parens-error-3.txt +1 -1
- package/test/less/errors/single-character.less +1 -0
- package/test/less/errors/single-character.txt +2 -0
- package/test/less/functions.less +5 -0
- package/test/less/import/import-interpolation.less +1 -0
- package/test/less/import/import-reference.less +38 -0
- package/test/less/import-reference.less +3 -1
- package/test/less/import.less +2 -0
- package/test/less/include-path/include-path.less +6 -0
- package/test/less/mixins-important.less +12 -0
- package/test/less/nested-gradient-with-svg-gradient/mixin-consumer.less +5 -0
- package/test/less/nested-gradient-with-svg-gradient/svg-gradient-mixin.less +15 -0
- package/test/less/selectors.less +19 -4
- package/test/less/urls.less +10 -1
- package/test/less/variables.less +17 -3
- package/test/less-bom/charsets.less +3 -0
- package/test/less-bom/colors.less +98 -0
- package/test/less-bom/comments.less +102 -0
- package/test/less-bom/comments2.less +20 -0
- package/test/less-bom/compression/compression.less +36 -0
- package/test/less-bom/css-3.less +154 -0
- package/test/less-bom/css-escapes.less +33 -0
- package/test/less-bom/css-guards.less +103 -0
- package/test/less-bom/css.less +108 -0
- package/test/less-bom/debug/import/test.less +25 -0
- package/test/less-bom/debug/linenumbers.less +33 -0
- package/test/less-bom/detached-rulesets.less +103 -0
- package/test/less-bom/empty.less +1 -0
- package/test/less-bom/errors/add-mixed-units.less +3 -0
- package/test/less-bom/errors/add-mixed-units.txt +4 -0
- package/test/less-bom/errors/add-mixed-units2.less +3 -0
- package/test/less-bom/errors/add-mixed-units2.txt +4 -0
- package/test/less-bom/errors/at-rules-undefined-var.less +4 -0
- package/test/less-bom/errors/at-rules-undefined-var.txt +4 -0
- package/test/less-bom/errors/bad-variable-declaration1.less +1 -0
- package/test/less-bom/errors/bad-variable-declaration1.txt +2 -0
- package/test/less-bom/errors/color-func-invalid-color.less +3 -0
- package/test/less-bom/errors/color-func-invalid-color.txt +4 -0
- package/test/less-bom/errors/color-invalid-hex-code.less +3 -0
- package/test/less-bom/errors/color-invalid-hex-code.txt +4 -0
- package/test/less-bom/errors/color-invalid-hex-code2.less +3 -0
- package/test/less-bom/errors/color-invalid-hex-code2.txt +4 -0
- package/test/less-bom/errors/css-guard-default-func.less +4 -0
- package/test/less-bom/errors/css-guard-default-func.txt +4 -0
- package/test/less-bom/errors/detached-ruleset-1.less +6 -0
- package/test/less-bom/errors/detached-ruleset-1.txt +4 -0
- package/test/less-bom/errors/detached-ruleset-2.less +6 -0
- package/test/less-bom/errors/detached-ruleset-2.txt +4 -0
- package/test/less-bom/errors/detached-ruleset-3.less +4 -0
- package/test/less-bom/errors/detached-ruleset-3.txt +4 -0
- package/test/less-bom/errors/detached-ruleset-4.less +5 -0
- package/test/less-bom/errors/detached-ruleset-4.txt +4 -0
- package/test/less-bom/errors/detached-ruleset-5.less +4 -0
- package/test/less-bom/errors/detached-ruleset-5.txt +3 -0
- package/test/less-bom/errors/detached-ruleset-6.less +5 -0
- package/test/less-bom/errors/detached-ruleset-6.txt +4 -0
- package/test/less-bom/errors/divide-mixed-units.less +3 -0
- package/test/less-bom/errors/divide-mixed-units.txt +4 -0
- package/test/less-bom/errors/extend-no-selector.less +3 -0
- package/test/less-bom/errors/extend-no-selector.txt +3 -0
- package/test/less-bom/errors/extend-not-at-end.less +3 -0
- package/test/less-bom/errors/extend-not-at-end.txt +3 -0
- package/test/less-bom/errors/import-malformed.less +1 -0
- package/test/less-bom/errors/import-malformed.txt +3 -0
- package/test/less-bom/errors/import-missing.less +6 -0
- package/test/less-bom/errors/import-missing.txt +3 -0
- package/test/less-bom/errors/import-no-semi.less +1 -0
- package/test/less-bom/errors/import-no-semi.txt +2 -0
- package/test/less-bom/errors/import-subfolder1.less +1 -0
- package/test/less-bom/errors/import-subfolder1.txt +3 -0
- package/test/less-bom/errors/import-subfolder2.less +1 -0
- package/test/less-bom/errors/import-subfolder2.txt +4 -0
- package/test/less-bom/errors/imports/import-subfolder1.less +1 -0
- package/test/less-bom/errors/imports/import-subfolder2.less +1 -0
- package/test/less-bom/errors/imports/import-test.less +4 -0
- package/test/less-bom/errors/imports/subfolder/mixin-not-defined.less +1 -0
- package/test/less-bom/errors/imports/subfolder/parse-error-curly-bracket.less +1 -0
- package/test/less-bom/errors/javascript-error.less +3 -0
- package/test/less-bom/errors/javascript-error.txt +4 -0
- package/test/less-bom/errors/javascript-undefined-var.less +3 -0
- package/test/less-bom/errors/javascript-undefined-var.txt +4 -0
- package/test/less-bom/errors/mixed-mixin-definition-args-1.less +6 -0
- package/test/less-bom/errors/mixed-mixin-definition-args-1.txt +4 -0
- package/test/less-bom/errors/mixed-mixin-definition-args-2.less +6 -0
- package/test/less-bom/errors/mixed-mixin-definition-args-2.txt +4 -0
- package/test/less-bom/errors/mixin-not-defined.less +11 -0
- package/test/less-bom/errors/mixin-not-defined.txt +3 -0
- package/test/less-bom/errors/mixin-not-matched.less +6 -0
- package/test/less-bom/errors/mixin-not-matched.txt +3 -0
- package/test/less-bom/errors/mixin-not-matched2.less +6 -0
- package/test/less-bom/errors/mixin-not-matched2.txt +3 -0
- package/test/less-bom/errors/mixin-not-visible-in-scope-1.less +9 -0
- package/test/less-bom/errors/mixin-not-visible-in-scope-1.txt +4 -0
- package/test/less-bom/errors/mixins-guards-default-func-1.less +9 -0
- package/test/less-bom/errors/mixins-guards-default-func-1.txt +4 -0
- package/test/less-bom/errors/mixins-guards-default-func-2.less +9 -0
- package/test/less-bom/errors/mixins-guards-default-func-2.txt +4 -0
- package/test/less-bom/errors/mixins-guards-default-func-3.less +9 -0
- package/test/less-bom/errors/mixins-guards-default-func-3.txt +4 -0
- package/test/less-bom/errors/multiple-guards-on-css-selectors.less +4 -0
- package/test/less-bom/errors/multiple-guards-on-css-selectors.txt +4 -0
- package/test/less-bom/errors/multiple-guards-on-css-selectors2.less +4 -0
- package/test/less-bom/errors/multiple-guards-on-css-selectors2.txt +4 -0
- package/test/less-bom/errors/multiply-mixed-units.less +7 -0
- package/test/less-bom/errors/multiply-mixed-units.txt +4 -0
- package/test/less-bom/errors/parens-error-1.less +3 -0
- package/test/less-bom/errors/parens-error-1.txt +4 -0
- package/test/less-bom/errors/parens-error-2.less +3 -0
- package/test/less-bom/errors/parens-error-2.txt +4 -0
- package/test/less-bom/errors/parens-error-3.less +3 -0
- package/test/less-bom/errors/parens-error-3.txt +4 -0
- package/test/less-bom/errors/parse-error-curly-bracket.less +4 -0
- package/test/less-bom/errors/parse-error-curly-bracket.txt +4 -0
- package/test/less-bom/errors/parse-error-extra-parens.less +5 -0
- package/test/less-bom/errors/parse-error-extra-parens.txt +3 -0
- package/test/less-bom/errors/parse-error-missing-bracket.less +2 -0
- package/test/less-bom/errors/parse-error-missing-bracket.txt +3 -0
- package/test/less-bom/errors/parse-error-missing-parens.less +5 -0
- package/test/less-bom/errors/parse-error-missing-parens.txt +3 -0
- package/test/less-bom/errors/parse-error-with-import.less +13 -0
- package/test/less-bom/errors/parse-error-with-import.txt +4 -0
- package/test/less-bom/errors/percentage-missing-space.less +3 -0
- package/test/less-bom/errors/percentage-missing-space.txt +4 -0
- package/test/less-bom/errors/property-asterisk-only-name.less +3 -0
- package/test/less-bom/errors/property-asterisk-only-name.txt +4 -0
- package/test/less-bom/errors/property-ie5-hack.less +3 -0
- package/test/less-bom/errors/property-ie5-hack.txt +3 -0
- package/test/less-bom/errors/property-in-root.less +4 -0
- package/test/less-bom/errors/property-in-root.txt +4 -0
- package/test/less-bom/errors/property-in-root2.less +1 -0
- package/test/less-bom/errors/property-in-root2.txt +4 -0
- package/test/less-bom/errors/property-in-root3.less +4 -0
- package/test/less-bom/errors/property-in-root3.txt +3 -0
- package/test/less-bom/errors/property-interp-not-defined.less +1 -0
- package/test/less-bom/errors/property-interp-not-defined.txt +2 -0
- package/test/less-bom/errors/recursive-variable.less +1 -0
- package/test/less-bom/errors/recursive-variable.txt +2 -0
- package/test/less-bom/errors/single-character.less +1 -0
- package/test/less-bom/errors/single-character.txt +2 -0
- package/test/less-bom/errors/svg-gradient1.less +3 -0
- package/test/less-bom/errors/svg-gradient1.txt +4 -0
- package/test/less-bom/errors/svg-gradient2.less +3 -0
- package/test/less-bom/errors/svg-gradient2.txt +4 -0
- package/test/less-bom/errors/svg-gradient3.less +3 -0
- package/test/less-bom/errors/svg-gradient3.txt +4 -0
- package/test/less-bom/errors/unit-function.less +3 -0
- package/test/less-bom/errors/unit-function.txt +4 -0
- package/test/less-bom/extend-chaining.less +91 -0
- package/test/less-bom/extend-clearfix.less +19 -0
- package/test/less-bom/extend-exact.less +46 -0
- package/test/less-bom/extend-media.less +24 -0
- package/test/less-bom/extend-nest.less +65 -0
- package/test/less-bom/extend-selector.less +99 -0
- package/test/less-bom/extend.less +81 -0
- package/test/less-bom/extract-and-length.less +133 -0
- package/test/less-bom/functions.less +201 -0
- package/test/less-bom/globalVars/extended.json +5 -0
- package/test/less-bom/globalVars/extended.less +10 -0
- package/test/less-bom/globalVars/simple.json +3 -0
- package/test/less-bom/globalVars/simple.less +3 -0
- package/test/less-bom/ie-filters.less +15 -0
- package/test/less-bom/import/deeper/deeper-2/url-import-2.less +3 -0
- package/test/less-bom/import/deeper/deeper-2/url-import.less +1 -0
- package/test/less-bom/import/deeper/import-once-test-a.less +1 -0
- package/test/less-bom/import/deeper/url-import.less +1 -0
- package/test/less-bom/import/import-and-relative-paths-test.less +17 -0
- package/test/less-bom/import/import-charset-test.less +1 -0
- package/test/less-bom/import/import-interpolation.less +2 -0
- package/test/less-bom/import/import-interpolation2.less +5 -0
- package/test/less-bom/import/import-once-test-c.less +6 -0
- package/test/less-bom/import/import-reference.less +89 -0
- package/test/less-bom/import/import-test-a.less +4 -0
- package/test/less-bom/import/import-test-b.less +8 -0
- package/test/less-bom/import/import-test-c.less +6 -0
- package/test/less-bom/import/import-test-d.css +1 -0
- package/test/less-bom/import/import-test-e.less +2 -0
- package/test/less-bom/import/import-test-f.less +5 -0
- package/test/less-bom/import/imports/font.less +8 -0
- package/test/less-bom/import/imports/logo.less +5 -0
- package/test/less-bom/import/interpolation-vars.less +6 -0
- package/test/less-bom/import/invalid-css.less +1 -0
- package/test/less-bom/import/urls.less +1 -0
- package/test/less-bom/import-inline.less +3 -0
- package/test/less-bom/import-interpolation.less +8 -0
- package/test/less-bom/import-once.less +6 -0
- package/test/less-bom/import-reference.less +23 -0
- package/test/less-bom/import.less +30 -0
- package/test/less-bom/include-path/include-path.less +6 -0
- package/test/less-bom/javascript.less +38 -0
- package/test/less-bom/lazy-eval.less +6 -0
- package/test/less-bom/legacy/legacy.less +7 -0
- package/test/less-bom/media.less +234 -0
- package/test/less-bom/merge.less +78 -0
- package/test/less-bom/mixins-args.less +215 -0
- package/test/less-bom/mixins-closure.less +26 -0
- package/test/less-bom/mixins-guards-default-func.less +195 -0
- package/test/less-bom/mixins-guards.less +271 -0
- package/test/less-bom/mixins-important.less +37 -0
- package/test/less-bom/mixins-interpolated.less +75 -0
- package/test/less-bom/mixins-named-args.less +36 -0
- package/test/less-bom/mixins-nested.less +22 -0
- package/test/less-bom/mixins-pattern.less +102 -0
- package/test/less-bom/mixins.less +145 -0
- package/test/less-bom/modifyVars/extended.json +5 -0
- package/test/less-bom/modifyVars/extended.less +11 -0
- package/test/less-bom/nested-gradient-with-svg-gradient/mixin-consumer.less +5 -0
- package/test/less-bom/nested-gradient-with-svg-gradient/svg-gradient-mixin.less +15 -0
- package/test/less-bom/no-js-errors/no-js-errors.less +3 -0
- package/test/less-bom/no-js-errors/no-js-errors.txt +4 -0
- package/test/less-bom/no-output.less +2 -0
- package/test/less-bom/operations.less +62 -0
- package/test/less-bom/parens.less +45 -0
- package/test/less-bom/property-name-interp.less +56 -0
- package/test/less-bom/rulesets.less +30 -0
- package/test/less-bom/scope.less +104 -0
- package/test/less-bom/selectors.less +174 -0
- package/test/less-bom/sourcemaps/basic.json +3 -0
- package/test/less-bom/sourcemaps/basic.less +27 -0
- package/test/less-bom/sourcemaps/imported.css +7 -0
- package/test/less-bom/static-urls/urls.less +33 -0
- package/test/less-bom/strict-units/strict-units.less +4 -0
- package/test/less-bom/strings.less +73 -0
- package/test/less-bom/url-args/urls.less +63 -0
- package/test/less-bom/urls.less +94 -0
- package/test/less-bom/variables-in-at-rules.less +20 -0
- package/test/less-bom/variables.less +119 -0
- package/test/less-bom/whitespace.less +44 -0
- package/test/less-test.js +127 -28
- package/test/modify-vars.js +6 -4
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var Dimension = require("../less/tree/dimension"),
|
|
2
|
+
Expression = require("../less/tree/expression"),
|
|
3
|
+
functionRegistry = require("./../less/functions/function-registry"),
|
|
4
|
+
path = require("path");
|
|
5
|
+
|
|
6
|
+
function imageSize(filePathNode) {
|
|
7
|
+
var filePath = filePathNode.value;
|
|
8
|
+
var currentDirectory = filePathNode.currentFileInfo.relativeUrls ?
|
|
9
|
+
filePathNode.currentFileInfo.currentDirectory : filePathNode.currentFileInfo.entryPath;
|
|
10
|
+
|
|
11
|
+
var sizeOf = require('image-size');
|
|
12
|
+
filePath = path.join(currentDirectory, filePath);
|
|
13
|
+
return sizeOf(filePath);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
var imageFunctions = {
|
|
17
|
+
"image-size": function(filePathNode) {
|
|
18
|
+
var size = imageSize(filePathNode);
|
|
19
|
+
return new Expression([
|
|
20
|
+
new Dimension(size.width, "px"),
|
|
21
|
+
new Dimension(size.height, "px")
|
|
22
|
+
]);
|
|
23
|
+
},
|
|
24
|
+
"image-width": function(filePathNode) {
|
|
25
|
+
var size = imageSize(filePathNode);
|
|
26
|
+
return new Dimension(size.width, "px");
|
|
27
|
+
},
|
|
28
|
+
"image-height": function(filePathNode) {
|
|
29
|
+
var size = imageSize(filePathNode);
|
|
30
|
+
return new Dimension(size.height, "px");
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
functionRegistry.addMultiple(imageFunctions);
|
package/lib/less-node/index.js
CHANGED
|
@@ -37,12 +37,11 @@ var lessc_helper = {
|
|
|
37
37
|
console.log(" --strict-imports Forces evaluation of imports.");
|
|
38
38
|
console.log(" --insecure Allows imports from insecure https hosts.");
|
|
39
39
|
console.log(" -v, --version Prints version number and exit.");
|
|
40
|
-
console.log(" -x, --compress Compresses output by removing some whitespaces.");
|
|
41
40
|
console.log(" --source-map[=FILENAME] Outputs a v3 sourcemap to the filename (or output filename.map).");
|
|
42
41
|
console.log(" --source-map-rootpath=X Adds this path onto the sourcemap filename and less file paths.");
|
|
43
42
|
console.log(" --source-map-basepath=X Sets sourcemap base path, defaults to current working directory.");
|
|
44
43
|
console.log(" --source-map-less-inline Puts the less files into the map instead of referencing them.");
|
|
45
|
-
console.log(" --source-map-map-inline Puts the map (and any less files) into the output css file.");
|
|
44
|
+
console.log(" --source-map-map-inline Puts the map (and any less files) as a base64 data uri into the output css file.");
|
|
46
45
|
console.log(" --source-map-url=URL Sets a custom URL to map file, for sourceMappingURL comment");
|
|
47
46
|
console.log(" in generated CSS file.");
|
|
48
47
|
console.log(" -rp, --rootpath=URL Sets rootpath for url rewriting in relative imports and urls");
|
|
@@ -71,6 +70,8 @@ var lessc_helper = {
|
|
|
71
70
|
console.log(" media query which is compatible with the SASS");
|
|
72
71
|
console.log(" format, and 'all' which will do both.");
|
|
73
72
|
console.log(" --verbose Be verbose.");
|
|
73
|
+
console.log(" -x, --compress Compresses output by removing some whitespaces.");
|
|
74
|
+
console.log(" We recommend you use a dedicated minifer like less-plugin-clean-css");
|
|
74
75
|
console.log("");
|
|
75
76
|
console.log("Report bugs to: http://github.com/less/less.js/issues");
|
|
76
77
|
console.log("Home page: <http://lesscss.org/>");
|
|
@@ -35,7 +35,7 @@ UrlFileManager.prototype.loadFile = function(filename, currentDirectory, options
|
|
|
35
35
|
|
|
36
36
|
request.get({uri: urlStr, strictSSL: !options.insecure }, function (error, res, body) {
|
|
37
37
|
if (error) {
|
|
38
|
-
reject({ type: 'File', message: "resource '" + urlStr + "' gave this Error:\n "+ error +"\n" });
|
|
38
|
+
reject({ type: 'File', message: "resource '" + urlStr + "' gave this Error:\n " + error + "\n" });
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
41
|
if (res && res.statusCode === 404) {
|
|
@@ -43,7 +43,7 @@ UrlFileManager.prototype.loadFile = function(filename, currentDirectory, options
|
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
if (!body) {
|
|
46
|
-
logger.warn('Warning: Empty body (HTTP '+ res.statusCode + ') returned by "' + urlStr +'"');
|
|
46
|
+
logger.warn('Warning: Empty body (HTTP '+ res.statusCode + ') returned by "' + urlStr + '"');
|
|
47
47
|
}
|
|
48
48
|
fulfill({ contents: body, filename: urlStr });
|
|
49
49
|
});
|
package/lib/less-rhino/index.js
CHANGED
|
@@ -114,7 +114,7 @@ less.Parser.fileLoader = function (file, currentFileInfo, callback, env) {
|
|
|
114
114
|
|
|
115
115
|
var j = file.lastIndexOf('/');
|
|
116
116
|
if(newFileInfo.relativeUrls && !/^(?:[a-z-]+:|\/)/.test(file) && j != -1) {
|
|
117
|
-
var relativeSubDirectory = file.slice(0, j+1);
|
|
117
|
+
var relativeSubDirectory = file.slice(0, j + 1);
|
|
118
118
|
newFileInfo.rootpath = newFileInfo.rootpath + relativeSubDirectory; // append (sub|sup) directory path of imported file
|
|
119
119
|
}
|
|
120
120
|
newFileInfo.currentDirectory = path;
|
|
@@ -135,7 +135,6 @@ less.Parser.fileLoader = function (file, currentFileInfo, callback, env) {
|
|
|
135
135
|
}
|
|
136
136
|
};
|
|
137
137
|
|
|
138
|
-
|
|
139
138
|
function writeFile(filename, content) {
|
|
140
139
|
var fstream = new java.io.FileWriter(filename);
|
|
141
140
|
var out = new java.io.BufferedWriter(fstream);
|
|
@@ -178,7 +177,7 @@ function writeFile(filename, content) {
|
|
|
178
177
|
var checkBooleanArg = function(arg) {
|
|
179
178
|
var onOff = /^((on|t|true|y|yes)|(off|f|false|n|no))$/i.exec(arg);
|
|
180
179
|
if (!onOff) {
|
|
181
|
-
print(" unable to parse "+arg+" as a boolean. use one of on/t/true/y/yes/off/f/false/n/no");
|
|
180
|
+
print(" unable to parse " + arg + " as a boolean. use one of on/t/true/y/yes/off/f/false/n/no");
|
|
182
181
|
continueProcessing = false;
|
|
183
182
|
return false;
|
|
184
183
|
}
|
|
@@ -371,7 +370,6 @@ function writeFile(filename, content) {
|
|
|
371
370
|
options.sourceMapOutputFilename = options.sourceMap;
|
|
372
371
|
}
|
|
373
372
|
|
|
374
|
-
|
|
375
373
|
if (!name) {
|
|
376
374
|
console.log("lessc: no inout files");
|
|
377
375
|
console.log("");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "less",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "Leaner CSS",
|
|
5
5
|
"homepage": "http://lesscss.org",
|
|
6
6
|
"author": {
|
|
@@ -40,12 +40,14 @@
|
|
|
40
40
|
"test": "grunt test"
|
|
41
41
|
},
|
|
42
42
|
"optionalDependencies": {
|
|
43
|
-
"
|
|
43
|
+
"errno": "^0.1.1",
|
|
44
|
+
"graceful-fs": "^3.0.5",
|
|
45
|
+
"image-size": "~0.3.5",
|
|
44
46
|
"mime": "^1.2.11",
|
|
45
|
-
"request": "^2.48.0",
|
|
46
47
|
"mkdirp": "^0.5.0",
|
|
47
|
-
"
|
|
48
|
-
"
|
|
48
|
+
"promise": "^6.0.1",
|
|
49
|
+
"request": "^2.51.0",
|
|
50
|
+
"source-map": "^0.2.0"
|
|
49
51
|
},
|
|
50
52
|
"devDependencies": {
|
|
51
53
|
"diff": "^1.0",
|
|
@@ -54,8 +56,9 @@
|
|
|
54
56
|
"grunt-contrib-concat": "^0.5.0",
|
|
55
57
|
"grunt-contrib-connect": "^0.9.0",
|
|
56
58
|
"grunt-contrib-jasmine": "^0.8.1",
|
|
57
|
-
"grunt-contrib-jshint": "^0.
|
|
58
|
-
"grunt-contrib-uglify": "^0.
|
|
59
|
+
"grunt-contrib-jshint": "^0.11.0",
|
|
60
|
+
"grunt-contrib-uglify": "^0.7.0",
|
|
61
|
+
"grunt-jscs": "^1.2.0",
|
|
59
62
|
"grunt-shell": "^1.1.1",
|
|
60
63
|
"grunt-browserify": "^3.2.0",
|
|
61
64
|
"matchdep": "^0.3.0",
|
package/test/browser/common.js
CHANGED
|
@@ -130,10 +130,10 @@ var testErrorSheet = function (sheet) {
|
|
|
130
130
|
.replace(/<h3>|<\/?p>|<a href="[^"]*">|<\/a>|<ul>|<\/?pre( class="?[^">]*"?)?>|<\/li>|<\/?label>/ig, "")
|
|
131
131
|
.replace(/<\/h3>/ig, " ")
|
|
132
132
|
.replace(/<li>|<\/ul>|<br>/ig, "\n"))
|
|
133
|
-
.replace(/&/ig,"&")
|
|
133
|
+
.replace(/&/ig, "&")
|
|
134
134
|
// for IE8
|
|
135
|
-
.replace(/\r\n/g,"\n")
|
|
136
|
-
.replace(/\. \nin/,". in");
|
|
135
|
+
.replace(/\r\n/g, "\n")
|
|
136
|
+
.replace(/\. \nin/, ". in");
|
|
137
137
|
actualErrorMsg = innerText
|
|
138
138
|
.replace(/\n\d+/g, function (lineNo) {
|
|
139
139
|
return lineNo + " ";
|
|
@@ -145,10 +145,11 @@ var testErrorSheet = function (sheet) {
|
|
|
145
145
|
errorFile
|
|
146
146
|
.then(function (errorTxt) {
|
|
147
147
|
errorTxt = errorTxt
|
|
148
|
-
.replace(
|
|
149
|
-
.replace(
|
|
150
|
-
.replace(
|
|
151
|
-
.replace(
|
|
148
|
+
.replace(/\{path\}/g, "")
|
|
149
|
+
.replace(/\{pathrel\}/g, "")
|
|
150
|
+
.replace(/\{pathhref\}/g, "http://localhost:8081/test/less/errors/")
|
|
151
|
+
.replace(/\{404status\}/g, " (404)")
|
|
152
|
+
.replace(/\{node\}.*\{\/node\}/g, "")
|
|
152
153
|
.replace(/\n$/, "");
|
|
153
154
|
expect(actualErrorMsg).toEqual(errorTxt);
|
|
154
155
|
if (errorTxt == actualErrorMsg) {
|
|
@@ -177,10 +178,11 @@ var testErrorSheetConsole = function (sheet) {
|
|
|
177
178
|
errorFile
|
|
178
179
|
.then(function (errorTxt) {
|
|
179
180
|
errorTxt
|
|
180
|
-
.replace(
|
|
181
|
-
.replace(
|
|
182
|
-
.replace(
|
|
183
|
-
.replace(
|
|
181
|
+
.replace(/\{path\}/g, "")
|
|
182
|
+
.replace(/\{pathrel\}/g, "")
|
|
183
|
+
.replace(/\{pathhref\}/g, "http://localhost:8081/browser/less/")
|
|
184
|
+
.replace(/\{404status\}/g, " (404)")
|
|
185
|
+
.replace(/\{node\}.*\{\/node\}/g, "")
|
|
184
186
|
.trim();
|
|
185
187
|
expect(actualErrorMsg).toEqual(errorTxt);
|
|
186
188
|
done();
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
.modify {
|
|
7
7
|
my-url: url("http://localhost:8081/test/browser/less/b.png");
|
|
8
8
|
}
|
|
9
|
+
.gray-gradient {
|
|
10
|
+
background: url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%201%201%22%20preserveAspectRatio%3D%22none%22%3E%3ClinearGradient%20id%3D%22gradient%22%20gradientUnits%3D%22userSpaceOnUse%22%20x1%3D%220%25%22%20y1%3D%220%25%22%20x2%3D%220%25%22%20y2%3D%22100%25%22%3E%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220%22%2F%3E%3Cstop%20offset%3D%2260%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.05%22%2F%3E%3Cstop%20offset%3D%2270%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.1%22%2F%3E%3Cstop%20offset%3D%2273%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.15%22%2F%3E%3Cstop%20offset%3D%2275%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.2%22%2F%3E%3Cstop%20offset%3D%2280%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.25%22%2F%3E%3Cstop%20offset%3D%2285%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.3%22%2F%3E%3Cstop%20offset%3D%2288%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.35%22%2F%3E%3Cstop%20offset%3D%2290%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.4%22%2F%3E%3Cstop%20offset%3D%2295%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.45%22%2F%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.5%22%2F%3E%3C%2FlinearGradient%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22url(%23gradient)%22%20%2F%3E%3C%2Fsvg%3E');
|
|
11
|
+
}
|
|
9
12
|
@font-face {
|
|
10
13
|
src: url("/fonts/garamond-pro.ttf");
|
|
11
14
|
src: local(Futura-Medium), url(http://localhost:8081/test/browser/less/fonts.svg#MyGeometricModern) format("svg");
|
|
@@ -48,7 +51,7 @@
|
|
|
48
51
|
uri: url('http://localhost:8081/test/data/data-uri-fail.png');
|
|
49
52
|
}
|
|
50
53
|
#svg-functions {
|
|
51
|
-
background-image: url('data:image/svg+xml
|
|
52
|
-
background-image: url('data:image/svg+xml
|
|
53
|
-
background-image: url('data:image/svg+xml
|
|
54
|
+
background-image: url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%201%201%22%20preserveAspectRatio%3D%22none%22%3E%3ClinearGradient%20id%3D%22gradient%22%20gradientUnits%3D%22userSpaceOnUse%22%20x1%3D%220%25%22%20y1%3D%220%25%22%20x2%3D%220%25%22%20y2%3D%22100%25%22%3E%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%23000000%22%2F%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23ffffff%22%2F%3E%3C%2FlinearGradient%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22url(%23gradient)%22%20%2F%3E%3C%2Fsvg%3E');
|
|
55
|
+
background-image: url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%201%201%22%20preserveAspectRatio%3D%22none%22%3E%3ClinearGradient%20id%3D%22gradient%22%20gradientUnits%3D%22userSpaceOnUse%22%20x1%3D%220%25%22%20y1%3D%220%25%22%20x2%3D%220%25%22%20y2%3D%22100%25%22%3E%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%23000000%22%2F%3E%3Cstop%20offset%3D%223%25%22%20stop-color%3D%22%23ffa500%22%2F%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23ffffff%22%2F%3E%3C%2FlinearGradient%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22url(%23gradient)%22%20%2F%3E%3C%2Fsvg%3E');
|
|
56
|
+
background-image: url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%201%201%22%20preserveAspectRatio%3D%22none%22%3E%3ClinearGradient%20id%3D%22gradient%22%20gradientUnits%3D%22userSpaceOnUse%22%20x1%3D%220%25%22%20y1%3D%220%25%22%20x2%3D%220%25%22%20y2%3D%22100%25%22%3E%3Cstop%20offset%3D%221%25%22%20stop-color%3D%22%23c4c4c4%22%2F%3E%3Cstop%20offset%3D%223%25%22%20stop-color%3D%22%23ffa500%22%2F%3E%3Cstop%20offset%3D%225%25%22%20stop-color%3D%22%23008000%22%2F%3E%3Cstop%20offset%3D%2295%25%22%20stop-color%3D%22%23ffffff%22%2F%3E%3C%2FlinearGradient%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22url(%23gradient)%22%20%2F%3E%3C%2Fsvg%3E');
|
|
54
57
|
}
|
|
@@ -180,7 +180,6 @@
|
|
|
180
180
|
// export public
|
|
181
181
|
jasmine.JSReporter = JSReporter;
|
|
182
182
|
|
|
183
|
-
|
|
184
183
|
// ------------------------------------------------------------------------
|
|
185
184
|
// Jasmine JSReporter for Jasmine 2.0
|
|
186
185
|
// ------------------------------------------------------------------------
|
|
@@ -240,7 +239,7 @@
|
|
|
240
239
|
suite.specs = [];
|
|
241
240
|
suite.suites = [];
|
|
242
241
|
suite.passed = true;
|
|
243
|
-
suite.parentId = this.suiteStack.slice(this.suiteStack.length -1)[0];
|
|
242
|
+
suite.parentId = this.suiteStack.slice(this.suiteStack.length - 1)[0];
|
|
244
243
|
if (suite.parentId) {
|
|
245
244
|
this.suites[suite.parentId].suites.push(suite);
|
|
246
245
|
} else {
|
|
@@ -273,7 +272,7 @@
|
|
|
273
272
|
spec = this._cacheSpec(spec);
|
|
274
273
|
spec.timer = new Timer().start();
|
|
275
274
|
// build up suites->spec tree as we go
|
|
276
|
-
spec.suiteId = this.suiteStack.slice(this.suiteStack.length -1)[0];
|
|
275
|
+
spec.suiteId = this.suiteStack.slice(this.suiteStack.length - 1)[0];
|
|
277
276
|
this.suites[spec.suiteId].specs.push(spec);
|
|
278
277
|
};
|
|
279
278
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.gradient-mixin(@color) {
|
|
2
|
+
background: svg-gradient(to bottom,
|
|
3
|
+
fade(@color, 0%) 0%,
|
|
4
|
+
fade(@color, 5%) 60%,
|
|
5
|
+
fade(@color, 10%) 70%,
|
|
6
|
+
fade(@color, 15%) 73%,
|
|
7
|
+
fade(@color, 20%) 75%,
|
|
8
|
+
fade(@color, 25%) 80%,
|
|
9
|
+
fade(@color, 30%) 85%,
|
|
10
|
+
fade(@color, 35%) 88%,
|
|
11
|
+
fade(@color, 40%) 90%,
|
|
12
|
+
fade(@color, 45%) 95%,
|
|
13
|
+
fade(@color, 50%) 100%
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@import "imports/urls.less";
|
|
2
2
|
@import "http://localhost:8081/test/browser/less/imports/urls2.less";
|
|
3
|
+
@import "http://localhost:8081/test/browser/less/nested-gradient-with-svg-gradient/mixin-consumer.less";
|
|
3
4
|
@font-face {
|
|
4
5
|
src: url("/fonts/garamond-pro.ttf");
|
|
5
6
|
src: local(Futura-Medium),
|