less 2.0.8 → 2.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. data/lib/less/js/Makefile +8 -2
  2. data/lib/less/js/benchmark/less-benchmark.js +1 -1
  3. data/lib/less/js/bin/lessc +17 -11
  4. data/lib/less/js/build/amd.js +6 -0
  5. data/lib/less/js/dist/less-1.1.5.min.js +1 -8
  6. data/lib/less/js/dist/less-1.1.6.js +3004 -0
  7. data/lib/less/js/dist/less-1.1.6.min.js +9 -0
  8. data/lib/less/js/dist/less-1.2.0.js +3293 -0
  9. data/lib/less/js/dist/less-1.2.0.min.js +9 -0
  10. data/lib/less/js/dist/less-1.2.1.js +3318 -0
  11. data/lib/less/js/dist/less-1.2.1.min.js +9 -0
  12. data/lib/less/js/lib/less/browser.js +33 -28
  13. data/lib/less/js/lib/less/colors.js +151 -0
  14. data/lib/less/js/lib/less/cssmin.js +355 -0
  15. data/lib/less/js/lib/less/functions.js +49 -6
  16. data/lib/less/js/lib/less/index.js +21 -18
  17. data/lib/less/js/lib/less/parser.js +230 -92
  18. data/lib/less/js/lib/less/rhino.js +3 -1
  19. data/lib/less/js/lib/less/tree.js +6 -2
  20. data/lib/less/js/lib/less/tree/call.js +6 -3
  21. data/lib/less/js/lib/less/tree/condition.js +42 -0
  22. data/lib/less/js/lib/less/tree/dimension.js +15 -0
  23. data/lib/less/js/lib/less/tree/directive.js +8 -2
  24. data/lib/less/js/lib/less/tree/element.js +14 -2
  25. data/lib/less/js/lib/less/tree/expression.js +1 -1
  26. data/lib/less/js/lib/less/tree/import.js +13 -11
  27. data/lib/less/js/lib/less/tree/keyword.js +11 -1
  28. data/lib/less/js/lib/less/tree/mixin.js +31 -13
  29. data/lib/less/js/lib/less/tree/paren.js +16 -0
  30. data/lib/less/js/lib/less/tree/quoted.js +1 -1
  31. data/lib/less/js/lib/less/tree/rule.js +7 -3
  32. data/lib/less/js/lib/less/tree/ruleset.js +7 -4
  33. data/lib/less/js/lib/less/tree/selector.js +5 -0
  34. data/lib/less/js/lib/less/tree/variable.js +4 -2
  35. data/lib/less/js/package.json +1 -1
  36. data/lib/less/js/test/css/colors.css +10 -0
  37. data/lib/less/js/test/css/comments.css +9 -5
  38. data/lib/less/js/test/css/css-3.css +4 -2
  39. data/lib/less/js/test/css/css-escapes.css +1 -1
  40. data/lib/less/js/test/css/css.css +8 -4
  41. data/lib/less/js/test/css/functions.css +13 -0
  42. data/lib/less/js/test/css/import.css +10 -3
  43. data/lib/less/js/test/css/media.css +8 -2
  44. data/lib/less/js/test/css/mixins-args.css +5 -2
  45. data/lib/less/js/test/css/mixins-guards.css +58 -0
  46. data/lib/less/js/test/css/mixins-important.css +17 -0
  47. data/lib/less/js/test/css/mixins.css +2 -1
  48. data/lib/less/js/test/css/operations.css +3 -0
  49. data/lib/less/js/test/css/parens.css +1 -1
  50. data/lib/less/js/test/css/rulesets.css +6 -2
  51. data/lib/less/js/test/css/scope.css +6 -6
  52. data/lib/less/js/test/css/selectors.css +8 -4
  53. data/lib/less/js/test/css/strings.css +6 -4
  54. data/lib/less/js/test/css/variables.css +3 -0
  55. data/lib/less/js/test/css/whitespace.css +5 -3
  56. data/lib/less/js/test/less-test.js +1 -1
  57. data/lib/less/js/test/less/colors.less +13 -0
  58. data/lib/less/js/test/less/comments.less +8 -6
  59. data/lib/less/js/test/less/functions.less +15 -1
  60. data/lib/less/js/test/less/import.less +3 -1
  61. data/lib/less/js/test/less/import/import-test-e.less +2 -0
  62. data/lib/less/js/test/less/media.less +6 -0
  63. data/lib/less/js/test/less/mixins-args.less +6 -0
  64. data/lib/less/js/test/less/mixins-guards.less +94 -0
  65. data/lib/less/js/test/less/mixins-important.less +18 -0
  66. data/lib/less/js/test/less/operations.less +4 -0
  67. data/lib/less/js/test/less/strings.less +2 -0
  68. data/lib/less/js/test/less/variables.less +4 -0
  69. data/lib/less/version.rb +1 -1
  70. metadata +28 -12
@@ -7,15 +7,17 @@ tree.Ruleset = function (selectors, rules) {
7
7
  };
8
8
  tree.Ruleset.prototype = {
9
9
  eval: function (env) {
10
- var ruleset = new(tree.Ruleset)(this.selectors, this.rules.slice(0));
10
+ var selectors = this.selectors && this.selectors.map(function (s) { return s.eval(env) });
11
+ var ruleset = new(tree.Ruleset)(selectors, this.rules.slice(0));
11
12
 
12
13
  ruleset.root = this.root;
14
+ ruleset.allowImports = this.allowImports;
13
15
 
14
16
  // push the current ruleset to the frames stack
15
17
  env.frames.unshift(ruleset);
16
18
 
17
19
  // Evaluate imports
18
- if (ruleset.root) {
20
+ if (ruleset.root || ruleset.allowImports) {
19
21
  for (var i = 0; i < ruleset.rules.length; i++) {
20
22
  if (ruleset.rules[i] instanceof tree.Import) {
21
23
  Array.prototype.splice
@@ -120,7 +122,7 @@ tree.Ruleset.prototype = {
120
122
  if (context.length === 0) {
121
123
  paths = this.selectors.map(function (s) { return [s] });
122
124
  } else {
123
- this.joinSelectors( paths, context, this.selectors );
125
+ this.joinSelectors(paths, context, this.selectors);
124
126
  }
125
127
  }
126
128
 
@@ -160,7 +162,8 @@ tree.Ruleset.prototype = {
160
162
  return p.map(function (s) {
161
163
  return s.toCSS(env);
162
164
  }).join('').trim();
163
- }).join(env.compress ? ',' : (paths.length > 3 ? ',\n' : ', '));
165
+ }).join( env.compress ? ',' : ',\n');
166
+
164
167
  css.push(selector,
165
168
  (env.compress ? '{' : ' {\n ') +
166
169
  rules.join(env.compress ? '' : '\n ') +
@@ -22,6 +22,11 @@ tree.Selector.prototype.match = function (other) {
22
22
  }
23
23
  return true;
24
24
  };
25
+ tree.Selector.prototype.eval = function (env) {
26
+ return new(tree.Selector)(this.elements.map(function (e) {
27
+ return e.eval(env);
28
+ }));
29
+ };
25
30
  tree.Selector.prototype.toCSS = function (env) {
26
31
  if (this._css) { return this._css }
27
32
 
@@ -1,6 +1,6 @@
1
1
  (function (tree) {
2
2
 
3
- tree.Variable = function (name, index) { this.name = name, this.index = index };
3
+ tree.Variable = function (name, index, file) { this.name = name, this.index = index, this.file = file };
4
4
  tree.Variable.prototype = {
5
5
  eval: function (env) {
6
6
  var variable, v, name = this.name;
@@ -15,7 +15,9 @@ tree.Variable.prototype = {
15
15
  }
16
16
  })) { return variable }
17
17
  else {
18
- throw { message: "variable " + name + " is undefined",
18
+ throw { type: 'Name',
19
+ message: "variable " + name + " is undefined",
20
+ filename: this.file,
19
21
  index: this.index };
20
22
  }
21
23
  }
@@ -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.1.5",
8
+ "version" : "1.2.1",
9
9
  "bin" : { "lessc": "./bin/lessc" },
10
10
  "main" : "./lib/less/index",
11
11
  "directories" : { "test": "./test" },
@@ -46,3 +46,13 @@
46
46
  #00ff00 {
47
47
  color: #00ff00;
48
48
  }
49
+ .lightenblue {
50
+ color: #3333ff;
51
+ }
52
+ .darkenblue {
53
+ color: #0000cc;
54
+ }
55
+ .unknowncolors {
56
+ color: blue2;
57
+ border: 2px solid superred;
58
+ }
@@ -8,9 +8,9 @@
8
8
  Comment
9
9
 
10
10
  */
11
- /*
11
+ /*
12
12
  * Comment Test
13
- *
13
+ *
14
14
  * - cloudhead (http://cloudhead.net)
15
15
  *
16
16
  */
@@ -44,9 +44,13 @@
44
44
  color: grey;
45
45
  }
46
46
  */
47
- .selector, .lots, .comments {
48
- color: grey, /* blue */ orange;
47
+ .selector,
48
+ .lots,
49
+ .comments {
50
+ color: #808080, /* blue */ #ffa500;
51
+ -webkit-border-radius: 2px /* webkit only */;
52
+ -moz-border-radius: 8px /* moz only with operation */;
49
53
  }
50
54
  #last {
51
- color: blue;
55
+ color: #0000ff;
52
56
  }
@@ -1,6 +1,6 @@
1
1
  .comma-delimited {
2
2
  background: url(bg.jpg) no-repeat, url(bg.png) repeat-x top left, url(bg);
3
- text-shadow: -1px -1px 1px red, 6px 5px 5px yellow;
3
+ text-shadow: -1px -1px 1px #ff0000, 6px 5px 5px #ffff00;
4
4
  -moz-box-shadow: 0pt 0pt 2px rgba(255, 255, 255, 0.4) inset, 0pt 4px 6px rgba(255, 255, 255, 0.4) inset;
5
5
  }
6
6
  @font-face {
@@ -25,7 +25,9 @@ ul.comma > li:not(:only-child)::after {
25
25
  ol.comma > li:nth-last-child(2)::after {
26
26
  color: white;
27
27
  }
28
- li:nth-child(4n+1), li:nth-child(-5n), li:nth-child(-n+2) {
28
+ li:nth-child(4n+1),
29
+ li:nth-child(-5n),
30
+ li:nth-child(-n+2) {
29
31
  color: white;
30
32
  }
31
33
  a[href^="http://"] {
@@ -8,7 +8,7 @@
8
8
  background: red;
9
9
  }
10
10
  .\34 04 strong {
11
- color: fuchsia;
11
+ color: #ff00ff;
12
12
  font-weight: bold;
13
13
  }
14
14
  .trailingTest\+ {
@@ -8,7 +8,9 @@ div {
8
8
  * {
9
9
  min-width: 45em;
10
10
  }
11
- h1, h2 > a > p, h3 {
11
+ h1,
12
+ h2 > a > p,
13
+ h3 {
12
14
  color: none;
13
15
  }
14
16
  div.class {
@@ -33,10 +35,12 @@ div#id {
33
35
  font-family: 'Garamond Pro';
34
36
  src: url("/fonts/garamond-pro.ttf");
35
37
  }
36
- a:hover, a:link {
38
+ a:hover,
39
+ a:link {
37
40
  color: #999;
38
41
  }
39
- p, p:first-child {
42
+ p,
43
+ p:first-child {
40
44
  text-transform: none;
41
45
  }
42
46
  q:lang(no) {
@@ -64,7 +68,7 @@ p + h1 {
64
68
  width: .1em;
65
69
  background-color: #009998;
66
70
  background-image: url(images/image.jpg);
67
- background: -webkit-gradient(linear, left top, left bottom, from(red), to(blue));
71
+ background: -webkit-gradient(linear, left top, left bottom, from(#ff0000), to(#0000ff));
68
72
  margin: ;
69
73
  filter: alpha(opacity=100);
70
74
  }
@@ -24,6 +24,19 @@
24
24
  lightness: 95%;
25
25
  rounded: 11;
26
26
  roundedpx: 3px;
27
+ percentage: 20%;
28
+ color: #ff0011;
29
+ }
30
+ #built-in .is-a {
31
+ color: true;
32
+ color: true;
33
+ color: true;
34
+ keyword: true;
35
+ number: true;
36
+ string: true;
37
+ pixel: true;
38
+ percent: true;
39
+ em: true;
27
40
  }
28
41
  #alpha {
29
42
  alpha: rgba(153, 94, 51, 0.6);
@@ -1,16 +1,23 @@
1
1
  @import "import-test-d.css";
2
2
 
3
3
  @import url(http://fonts.googleapis.com/css?family=Open+Sans);
4
+
5
+ @import url(something.css) screen and (color) and (max-width: 600px);
4
6
  #import {
5
- color: red;
7
+ color: #ff0000;
6
8
  }
7
9
  .mixin {
8
10
  height: 10px;
9
- color: red;
11
+ color: #ff0000;
10
12
  }
11
13
  #import-test {
12
14
  height: 10px;
13
- color: red;
15
+ color: #ff0000;
14
16
  width: 10px;
15
17
  height: 30%;
16
18
  }
19
+ @media screen and (max-width: 600px) {
20
+ body {
21
+ width: 100%;
22
+ }
23
+ }
@@ -5,7 +5,8 @@
5
5
  .class .sub {
6
6
  width: 42;
7
7
  }
8
- .top, header > h1 {
8
+ .top,
9
+ header > h1 {
9
10
  color: #444444;
10
11
  }
11
12
  }
@@ -14,8 +15,13 @@
14
15
  max-width: 480;
15
16
  }
16
17
  }
17
- @media all and (orientation:portrait) {
18
+ @media all and (orientation: portrait) {
18
19
  aside {
19
20
  float: none;
20
21
  }
21
22
  }
23
+ @media handheld and (min-width: 42), screen and (min-width: 20em) {
24
+ body {
25
+ max-width: 480px;
26
+ }
27
+ }
@@ -6,7 +6,7 @@
6
6
  color: blue;
7
7
  width: 10px;
8
8
  height: 99%;
9
- border: 2px dotted black;
9
+ border: 2px dotted #000000;
10
10
  }
11
11
  .one-arg {
12
12
  width: 15px;
@@ -54,8 +54,11 @@ body {
54
54
  color: red;
55
55
  }
56
56
  .arguments {
57
- border: 1px solid black;
57
+ border: 1px solid #000000;
58
58
  }
59
59
  .arguments2 {
60
60
  border: 0px;
61
61
  }
62
+ .edge-case {
63
+ border: "{";
64
+ }
@@ -0,0 +1,58 @@
1
+ .light1 {
2
+ color: white;
3
+ margin: 1px;
4
+ }
5
+ .light2 {
6
+ color: black;
7
+ margin: 1px;
8
+ }
9
+ .max1 {
10
+ width: 6;
11
+ }
12
+ .max2 {
13
+ width: 8;
14
+ }
15
+ .glob1 {
16
+ margin: auto auto;
17
+ }
18
+ .ops1 {
19
+ height: gt-or-eq;
20
+ height: lt-or-eq;
21
+ }
22
+ .ops2 {
23
+ height: gt-or-eq;
24
+ height: not-eq;
25
+ }
26
+ .ops3 {
27
+ height: lt-or-eq;
28
+ height: not-eq;
29
+ }
30
+ .default1 {
31
+ content: default;
32
+ }
33
+ .test1 {
34
+ content: "true.";
35
+ }
36
+ .test2 {
37
+ content: "false.";
38
+ }
39
+ .test3 {
40
+ content: "false.";
41
+ }
42
+ .test4 {
43
+ content: "false.";
44
+ }
45
+ .test5 {
46
+ content: "false.";
47
+ }
48
+ .bool1 {
49
+ content: true and true;
50
+ content: true;
51
+ content: false, true;
52
+ content: false and true and true, true;
53
+ content: false, true and true;
54
+ content: false, false, true;
55
+ content: false, true and true and true, false;
56
+ content: not false;
57
+ content: not false and false, not false;
58
+ }
@@ -0,0 +1,17 @@
1
+ .class {
2
+ border: 1;
3
+ boxer: 1;
4
+ border: 2 !important;
5
+ boxer: 2 !important;
6
+ border: 3;
7
+ boxer: 3;
8
+ border: 4 !important;
9
+ boxer: 4 !important;
10
+ border: 5;
11
+ boxer: 5;
12
+ border: 0 !important;
13
+ boxer: 0 !important;
14
+ border: 9 !important;
15
+ border: 9;
16
+ boxer: 9;
17
+ }
@@ -48,7 +48,8 @@
48
48
  .direct {
49
49
  border-style: dotted;
50
50
  }
51
- .bo, .bar {
51
+ .bo,
52
+ .bar {
52
53
  width: 100%;
53
54
  }
54
55
  .bo {
@@ -26,6 +26,9 @@
26
26
  .shorthands {
27
27
  padding: -1px 2px 0 -4px;
28
28
  }
29
+ .rem-dimensions {
30
+ font-size: 5.5rem;
31
+ }
29
32
  .colors {
30
33
  color: #123;
31
34
  border-color: #334455;
@@ -1,5 +1,5 @@
1
1
  .parens {
2
- border: 2px solid black;
2
+ border: 2px solid #000000;
3
3
  margin: 1px 3px 16 3;
4
4
  width: 36;
5
5
  padding: 2px 36px;
@@ -13,7 +13,9 @@
13
13
  #first > .one > #second .two > #deux #third:focus #fifth > #sixth .seventh #eighth + #ninth {
14
14
  color: purple;
15
15
  }
16
- #first > .one > #second .two > #deux #fourth, #first > .one > #second .two > #deux #five, #first > .one > #second .two > #deux #six {
16
+ #first > .one > #second .two > #deux #fourth,
17
+ #first > .one > #second .two > #deux #five,
18
+ #first > .one > #second .two > #deux #six {
17
19
  color: #110000;
18
20
  }
19
21
  #first > .one > #second .two > #deux #fourth .seven,
@@ -24,6 +26,8 @@
24
26
  #first > .one > #second .two > #deux #six .eight > #nine {
25
27
  border: 1px solid black;
26
28
  }
27
- #first > .one > #second .two > #deux #fourth #ten, #first > .one > #second .two > #deux #five #ten, #first > .one > #second .two > #deux #six #ten {
29
+ #first > .one > #second .two > #deux #fourth #ten,
30
+ #first > .one > #second .two > #deux #five #ten,
31
+ #first > .one > #second .two > #deux #six #ten {
28
32
  color: red;
29
33
  }
@@ -2,14 +2,14 @@
2
2
  color: #998899;
3
3
  }
4
4
  .scope1 {
5
- color: blue;
6
- border-color: black;
5
+ color: #0000ff;
6
+ border-color: #000000;
7
7
  }
8
8
  .scope1 .scope2 {
9
- color: blue;
9
+ color: #0000ff;
10
10
  }
11
11
  .scope1 .scope2 .scope3 {
12
- color: red;
13
- border-color: black;
14
- background-color: white;
12
+ color: #ff0000;
13
+ border-color: #000000;
14
+ background-color: #ffffff;
15
15
  }
@@ -27,7 +27,8 @@ td {
27
27
  margin: 0;
28
28
  padding: 0;
29
29
  }
30
- td, input {
30
+ td,
31
+ input {
31
32
  line-height: 1em;
32
33
  }
33
34
  a {
@@ -42,12 +43,15 @@ div a {
42
43
  p a span {
43
44
  color: yellow;
44
45
  }
45
- .foo .bar .qux, .foo .baz .qux {
46
+ .foo .bar .qux,
47
+ .foo .baz .qux {
46
48
  display: block;
47
49
  }
48
- .qux .foo .bar, .qux .foo .baz {
50
+ .qux .foo .bar,
51
+ .qux .foo .baz {
49
52
  display: inline;
50
53
  }
51
- .qux .foo .bar .biz, .qux .foo .baz .biz {
54
+ .qux .foo .bar .biz,
55
+ .qux .foo .baz .biz {
52
56
  display: none;
53
57
  }