less 1.3.2 → 1.3.3

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # 1.3.3
2
+
3
+ 2012-12-30
4
+
5
+ - Fix critical bug with mixin call if using multiple brackets
6
+ - when using the filter contrast function, the function is passed through if the first argument is not a color
7
+
1
8
  # 1.3.2
2
9
 
3
10
  2012-12-28
@@ -173,6 +173,11 @@ tree.functions = {
173
173
  return this.desaturate(color, new(tree.Dimension)(100));
174
174
  },
175
175
  contrast: function (color, dark, light, threshold) {
176
+ // filter: contrast(3.2);
177
+ // should be kept as is, so check for color
178
+ if (!color.rgb) {
179
+ return null;
180
+ }
176
181
  if (typeof light === 'undefined') {
177
182
  light = this.rgba(255, 255, 255, 1.0);
178
183
  }
package/lib/less/index.js CHANGED
@@ -5,7 +5,7 @@ var path = require('path'),
5
5
  fs = require('fs');
6
6
 
7
7
  var less = {
8
- version: [1, 3, 2],
8
+ version: [1, 3, 3],
9
9
  Parser: require('./parser').Parser,
10
10
  importer: require('./parser').importer,
11
11
  tree: require('./tree'),
@@ -1085,7 +1085,7 @@ less.Parser = function Parser(env) {
1085
1085
  // depreciated, will be removed soon
1086
1086
  if ($('(')) {
1087
1087
  sel = $(this.entity);
1088
- expect(')');
1088
+ if (!$(')')) { return null; }
1089
1089
  return new(tree.Selector)([new(tree.Element)('', sel, i)]);
1090
1090
  }
1091
1091
 
@@ -1130,6 +1130,7 @@ less.Parser = function Parser(env) {
1130
1130
  //
1131
1131
  ruleset: function () {
1132
1132
  var selectors = [], s, rules, match, debugInfo;
1133
+
1133
1134
  save();
1134
1135
 
1135
1136
  if (env.dumpLineNumbers)
@@ -14,7 +14,8 @@ tree.Call.prototype = {
14
14
  // When evaluating a function call,
15
15
  // we either find the function in `tree.functions` [1],
16
16
  // in which case we call it, passing the evaluated arguments,
17
- // or we simply print it out as it appeared originally [2].
17
+ // if this returns null or we cannot find the function, we
18
+ // simply print it out as it appeared originally [2].
18
19
  //
19
20
  // The *functions.js* file contains the built-in functions.
20
21
  //
@@ -23,21 +24,26 @@ tree.Call.prototype = {
23
24
  // The function should receive the value, not the variable.
24
25
  //
25
26
  eval: function (env) {
26
- var args = this.args.map(function (a) { return a.eval(env) });
27
+ var args = this.args.map(function (a) { return a.eval(env) }),
28
+ result;
27
29
 
28
30
  if (this.name in tree.functions) { // 1.
29
31
  try {
30
- return tree.functions[this.name].apply(tree.functions, args);
32
+ result = tree.functions[this.name].apply(tree.functions, args);
33
+ if (result != null) {
34
+ return result;
35
+ }
31
36
  } catch (e) {
32
37
  throw { type: e.type || "Runtime",
33
38
  message: "error evaluating function `" + this.name + "`" +
34
39
  (e.message ? ': ' + e.message : ''),
35
40
  index: this.index, filename: this.filename };
36
41
  }
37
- } else { // 2.
38
- return new(tree.Anonymous)(this.name +
39
- "(" + args.map(function (a) { return a.toCSS(env) }).join(', ') + ")");
40
42
  }
43
+
44
+ // 2.
45
+ return new(tree.Anonymous)(this.name +
46
+ "(" + args.map(function (a) { return a.toCSS(env) }).join(', ') + ")");
41
47
  },
42
48
 
43
49
  toCSS: function (env) {
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "keywords" : ["css", "parser", "lesscss", "browser"],
6
6
  "author" : "Alexis Sellier <self@cloudhead.net>",
7
7
  "contributors" : [],
8
- "version" : "1.3.2",
8
+ "version" : "1.3.3",
9
9
  "bin" : { "lessc": "./bin/lessc" },
10
10
  "main" : "./lib/less/index",
11
11
  "directories" : { "test": "./test" },
@@ -24,6 +24,7 @@
24
24
  luma-yellow: 93%;
25
25
  luma-cyan: 79%;
26
26
  luma-white-alpha: 50%;
27
+ contrast-filter: contrast(30%);
27
28
  contrast-white: #000000;
28
29
  contrast-black: #ffffff;
29
30
  contrast-red: #ffffff;
@@ -113,3 +113,9 @@ h3 + * {
113
113
  .test-rec .recursion {
114
114
  color: black;
115
115
  }
116
+ .button {
117
+ padding-left: 44px;
118
+ }
119
+ .button.large {
120
+ padding-left: 40em;
121
+ }
@@ -28,6 +28,7 @@
28
28
  luma-yellow: luma(#ffff00);
29
29
  luma-cyan: luma(#00ffff);
30
30
  luma-white-alpha: luma(rgba(255,255,255,0.5));
31
+ contrast-filter: contrast(30%);
31
32
  contrast-white: contrast(#fff);
32
33
  contrast-black: contrast(#000);
33
34
  contrast-red: contrast(#ff0000);
@@ -105,3 +105,10 @@ h3 { .margin_between(15px, 5px); }
105
105
  .recursion();
106
106
  }
107
107
  }
108
+ .paddingFloat(@padding) { padding-left: @padding; }
109
+
110
+ .button {
111
+ .paddingFloat(((10px + 12) * 2));
112
+
113
+ &.large { .paddingFloat((10em * 2) * 2); }
114
+ }