unboxed-less 1.2.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. data/.gitignore +4 -0
  2. data/CHANGELOG +62 -0
  3. data/LICENSE +179 -0
  4. data/README.md +48 -0
  5. data/Rakefile +60 -0
  6. data/VERSION +1 -0
  7. data/bin/lessc +92 -0
  8. data/lib/ext.rb +31 -0
  9. data/lib/less.rb +32 -0
  10. data/lib/less/command.rb +98 -0
  11. data/lib/less/engine.rb +55 -0
  12. data/lib/less/engine/grammar/common.tt +29 -0
  13. data/lib/less/engine/grammar/entity.tt +130 -0
  14. data/lib/less/engine/grammar/less.tt +326 -0
  15. data/lib/less/engine/nodes.rb +9 -0
  16. data/lib/less/engine/nodes/element.rb +278 -0
  17. data/lib/less/engine/nodes/entity.rb +79 -0
  18. data/lib/less/engine/nodes/function.rb +84 -0
  19. data/lib/less/engine/nodes/literal.rb +171 -0
  20. data/lib/less/engine/nodes/property.rb +231 -0
  21. data/lib/less/engine/nodes/ruleset.rb +12 -0
  22. data/lib/less/engine/nodes/selector.rb +44 -0
  23. data/spec/command_spec.rb +102 -0
  24. data/spec/css/accessors.css +18 -0
  25. data/spec/css/big.css +3768 -0
  26. data/spec/css/colors.css +14 -0
  27. data/spec/css/comments.css +9 -0
  28. data/spec/css/css-3.css +17 -0
  29. data/spec/css/css.css +50 -0
  30. data/spec/css/functions.css +6 -0
  31. data/spec/css/import.css +12 -0
  32. data/spec/css/lazy-eval.css +1 -0
  33. data/spec/css/mixins-args.css +32 -0
  34. data/spec/css/mixins.css +28 -0
  35. data/spec/css/operations.css +28 -0
  36. data/spec/css/parens.css +20 -0
  37. data/spec/css/rulesets.css +17 -0
  38. data/spec/css/scope.css +11 -0
  39. data/spec/css/selectors.css +13 -0
  40. data/spec/css/strings.css +12 -0
  41. data/spec/css/variables.css +7 -0
  42. data/spec/css/whitespace.css +7 -0
  43. data/spec/engine_spec.rb +112 -0
  44. data/spec/less/accessors.less +20 -0
  45. data/spec/less/big.less +4810 -0
  46. data/spec/less/colors.less +35 -0
  47. data/spec/less/comments.less +46 -0
  48. data/spec/less/css-3.less +45 -0
  49. data/spec/less/css.less +104 -0
  50. data/spec/less/exceptions/mixed-units-error.less +3 -0
  51. data/spec/less/exceptions/name-error-1.0.less +3 -0
  52. data/spec/less/exceptions/syntax-error-1.0.less +3 -0
  53. data/spec/less/functions.less +6 -0
  54. data/spec/less/hidden.less +25 -0
  55. data/spec/less/import.less +8 -0
  56. data/spec/less/import/import-test-a.less +2 -0
  57. data/spec/less/import/import-test-b.less +8 -0
  58. data/spec/less/import/import-test-c.less +7 -0
  59. data/spec/less/import/import-test-d.css +1 -0
  60. data/spec/less/lazy-eval.less +6 -0
  61. data/spec/less/literal-css.less +11 -0
  62. data/spec/less/mixins-args.less +59 -0
  63. data/spec/less/mixins.less +43 -0
  64. data/spec/less/operations.less +39 -0
  65. data/spec/less/parens.less +26 -0
  66. data/spec/less/rulesets.less +30 -0
  67. data/spec/less/scope.less +32 -0
  68. data/spec/less/selectors.less +24 -0
  69. data/spec/less/strings.less +14 -0
  70. data/spec/less/variables.less +24 -0
  71. data/spec/less/whitespace.less +34 -0
  72. data/spec/spec.css +50 -0
  73. data/spec/spec_helper.rb +8 -0
  74. data/unboxed-less.gemspec +121 -0
  75. metadata +140 -0
@@ -0,0 +1,35 @@
1
+ #yelow {
2
+ #short {
3
+ color: #fea;
4
+ }
5
+ #long {
6
+ color: #ffeeaa;
7
+ }
8
+ #rgba {
9
+ color: rgba(255, 238, 170, 0.1);
10
+ }
11
+ }
12
+
13
+ #blue {
14
+ #short {
15
+ color: #00f;
16
+ }
17
+ #long {
18
+ color: #0000ff;
19
+ }
20
+ #rgba {
21
+ color: rgba(0, 0, 255, 0.1);
22
+ }
23
+ }
24
+
25
+ #overflow {
26
+ .a { color: #111111 - #444444; } // #000000
27
+ .b { color: #eee + #fff; } // #ffffff
28
+ .c { color: #aaa * 3; } // #ffffff
29
+ .d { color: #00ee00 + #009900; } // #00ff00
30
+ }
31
+
32
+ #grey {
33
+ color: rgb(200, 200, 200);
34
+ background-color: hsl(50, 0, 50);
35
+ }
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Comment Test
3
+ *
4
+ * - cloudhead (http://cloudhead.net)
5
+ *
6
+ */
7
+
8
+ ////////////////
9
+ @var: "content";
10
+ ////////////////
11
+
12
+ /* Colors
13
+ * ------
14
+ * #EDF8FC (background blue)
15
+ * #166C89 (darkest blue)
16
+ *
17
+ * Text:
18
+ * #333 (standard text) // A comment within a comment!
19
+ * #1F9EC9 (standard link)
20
+ *
21
+ */
22
+
23
+ /* @group Variables
24
+ ------------------- */
25
+ #comments {
26
+ /**/ // An empty comment
27
+ color: red; /* A C-style comment */
28
+ background-color: orange; // A little comment
29
+ font-size: 12px;
30
+
31
+ /* lost comment */ content: @var;
32
+
33
+ border: 1px solid black;
34
+
35
+ // padding & margin //
36
+ padding: 0;
37
+ margin: 2em;
38
+ } //
39
+
40
+ /* commented out
41
+ #more-comments {
42
+ color: grey;
43
+ }
44
+ */
45
+
46
+ //
@@ -0,0 +1,45 @@
1
+ .comma-delimited {
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;
4
+ -moz-box-shadow: 0pt 0pt 2px rgba(255, 255, 255, 0.4) inset,
5
+ 0pt 4px 6px rgba(255, 255, 255, 0.4) inset;
6
+ }
7
+ @font-face {
8
+ font-family: Headline;
9
+ src: local(Futura-Medium),
10
+ url(fonts.svg#MyGeometricModern) format("svg");
11
+ }
12
+ .other {
13
+ -moz-transform: translate(0, 11em) rotate(-90deg);
14
+ }
15
+ p:not([class*="lead"]) {
16
+ color: black;
17
+ }
18
+
19
+ input[type="text"].class#id[attr=32]:not(1) {
20
+ color: white;
21
+ }
22
+
23
+ div#id.class[a=1][b=2].class:not(1) {
24
+ color: white;
25
+ }
26
+
27
+ ul.comma > li:not(:only-child)::after {
28
+ color: white;
29
+ }
30
+
31
+ ol.comma > li:nth-last-child(2)::after {
32
+ color: white;
33
+ }
34
+
35
+ a[href^="http://"] {
36
+ color: black;
37
+ }
38
+
39
+ a[href$="http://"] {
40
+ color: black;
41
+ }
42
+
43
+ p::before {
44
+ color: black;
45
+ }
@@ -0,0 +1,104 @@
1
+ /*
2
+
3
+ a CSS File
4
+
5
+ */
6
+
7
+ div { color: black; }
8
+ div { width: 99%; }
9
+
10
+ * {
11
+ min-width: 45em;
12
+ }
13
+
14
+ h1, h2 > a > p, h3 {
15
+ color: none;
16
+ }
17
+
18
+ div.class {
19
+ color: blue;
20
+ }
21
+
22
+ div#id {
23
+ color: green;
24
+ }
25
+
26
+ .class#id {
27
+ color: purple;
28
+ }
29
+
30
+ .one.two.three {
31
+ color: grey;
32
+ }
33
+
34
+ @media print {
35
+ font-size: 3em;
36
+ }
37
+
38
+ @media screen {
39
+ font-size: 10px;
40
+ }
41
+
42
+ @font-face {
43
+ font-family: 'Garamond Pro';
44
+ src: url("/fonts/garamond-pro.ttf");
45
+ }
46
+
47
+ a:hover, a:link {
48
+ color: #999;
49
+ }
50
+
51
+ p, p:first-child {
52
+ text-transform: none;
53
+ }
54
+
55
+ q:lang(no) {
56
+ quotes: none;
57
+ }
58
+
59
+ p + h1 {
60
+ font-size: 2.2em;
61
+ }
62
+
63
+ input[type="text"] {
64
+ font-weight: normal;
65
+ }
66
+
67
+ h2[title] {
68
+ font-size: 100%;
69
+ }
70
+
71
+ [disabled] {
72
+ color: transparent;
73
+ }
74
+
75
+ #shorthands {
76
+ border: 1px solid #000;
77
+ font: 12px/16px Arial;
78
+ margin: 1px 0;
79
+ padding: 0 auto;
80
+ background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
81
+ }
82
+
83
+ #more-shorthands {
84
+ margin: 0;
85
+ padding: 1px 0 2px 0;
86
+ font: normal small/20px 'Trebuchet MS', Verdana, sans-serif;
87
+ }
88
+
89
+ .misc {
90
+ -moz-border-radius: 2px;
91
+ display: -moz-inline-stack;
92
+ width: .1em;
93
+ background-color: #009998;
94
+ background-image: url(images/image.jpg);
95
+ background: -webkit-gradient(linear, left top, left bottom, from(red), to(blue));
96
+ margin: ;
97
+ }
98
+
99
+ #important {
100
+ color: red !important;
101
+ width: 100%!important;
102
+ height: 20px ! important;
103
+ }
104
+
@@ -0,0 +1,3 @@
1
+ #mixed-units-error {
2
+ color: 1px + #fff;
3
+ }
@@ -0,0 +1,3 @@
1
+ #name-error {
2
+ color: @var;
3
+ }
@@ -0,0 +1,3 @@
1
+ #syntax-error {
2
+ color: blue;;
3
+ }
@@ -0,0 +1,6 @@
1
+ #functions {
2
+ color: color("evil red"); // #999999
3
+ width: increment(15);
4
+ height: undefined("self");
5
+ border-width: add(2, 3);
6
+ }
@@ -0,0 +1,25 @@
1
+ .hidden {
2
+ color: transparent;
3
+ .inside {
4
+ width: 0%;
5
+ }
6
+ };
7
+
8
+ .fully-hidden {
9
+ color: none;
10
+ };
11
+
12
+ .visible {
13
+ width: 100%;
14
+ .hidden {
15
+ color: black;
16
+ };
17
+ }
18
+
19
+ .mix {
20
+ .hidden;
21
+ }
22
+
23
+ .mix2 {
24
+ .visible;
25
+ }
@@ -0,0 +1,8 @@
1
+ @import url("import/import-test-a.less");
2
+ @import url("import/import-test-a.less");
3
+
4
+ #import-test {
5
+ .mixin;
6
+ width: 10px;
7
+ height: @a + 10%;
8
+ }
@@ -0,0 +1,2 @@
1
+ @import "import-test-b.less";
2
+ @a: 20%;
@@ -0,0 +1,8 @@
1
+ @import "import-test-c";
2
+
3
+ @b: 100%;
4
+
5
+ .mixin {
6
+ height: 10px;
7
+ color: @c;
8
+ }
@@ -0,0 +1,7 @@
1
+
2
+ @import "import-test-d.css";
3
+ @c: red;
4
+
5
+ #import {
6
+ color: @c;
7
+ }
@@ -0,0 +1 @@
1
+ #css { color: yellow; }
@@ -0,0 +1,6 @@
1
+ @var: @a;
2
+ @a: 100%;
3
+
4
+ .lazy-eval {
5
+ width: @var;
6
+ }
@@ -0,0 +1,11 @@
1
+ % {
2
+ @var: 2px;
3
+ #literal {
4
+ width: 2px * 2;
5
+ }
6
+ @media {
7
+ #nested {
8
+ color: red;
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,59 @@
1
+ .mixin (@a: 1px, @b: 50%) {
2
+ width: @a * 5;
3
+ height: @b - 1%;
4
+ }
5
+
6
+ .mixiny
7
+ (@a: 0, @b: 0) {
8
+ margin: @a;
9
+ padding: @b;
10
+ }
11
+
12
+ .hidden() {
13
+ color: transparent;
14
+ }
15
+
16
+ .two-args {
17
+ color: blue;
18
+ .mixin(2px, 100%);
19
+ }
20
+
21
+ .one-arg {
22
+ .mixin(3px);
23
+ }
24
+
25
+ .no-parens {
26
+ .mixin;
27
+ }
28
+
29
+ .no-args {
30
+ .mixin();
31
+ }
32
+
33
+ .var-args {
34
+ @var: 9;
35
+ .mixin(@var, @var * 2);
36
+ }
37
+
38
+ .multi-mix {
39
+ .mixin(2px, 30%);
40
+ .mixiny(4, 5);
41
+ }
42
+
43
+ .maxa(@arg1: 10, @arg2: #f00) {
44
+ padding: @arg1 * 2px;
45
+ color: @arg2;
46
+ }
47
+
48
+ body {
49
+ .maxa(15);
50
+ }
51
+
52
+ @glob: 5;
53
+ .global-mixin(@a:2) {
54
+ width: @glob + @a;
55
+ }
56
+
57
+ .scope-mix {
58
+ .global-mixin(3);
59
+ }
@@ -0,0 +1,43 @@
1
+ .mixin { border: 1px solid black; }
2
+ .mixout { border-color: orange; }
3
+ .borders { border-style: dashed; }
4
+
5
+ #namespace {
6
+ .borders {
7
+ border-style: dotted;
8
+ }
9
+ .biohazard {
10
+ content: "death";
11
+ .man {
12
+ color: transparent;
13
+ }
14
+ }
15
+ }
16
+ #theme > .mixin {
17
+ background-color: grey;
18
+ }
19
+ #container {
20
+ color: black;
21
+ .mixin, .mixout;
22
+ #theme > .mixin;
23
+ }
24
+
25
+ #header {
26
+ .milk {
27
+ color: white;
28
+ .mixin, #theme > .mixin;
29
+ }
30
+ #cookie {
31
+ .chips {
32
+ #namespace .borders;
33
+ .calories {
34
+ #container;
35
+ }
36
+ }
37
+ .borders;
38
+ }
39
+ }
40
+ .secure-zone { #namespace .biohazard .man; }
41
+ .direct {
42
+ #namespace > .borders;
43
+ }
@@ -0,0 +1,39 @@
1
+ #operations {
2
+ color: #110000 + #000011 + #001100; // #111111
3
+ height: 10px / 2px + 6px - 1px * 2; // 9px
4
+ width: 2 * 4 - 5em; // 3em
5
+ .spacing {
6
+ height: 10px / 2px+6px-1px*2;
7
+ width: 2 * 4-5em;
8
+ }
9
+ }
10
+
11
+ @x: 4;
12
+ @y: 12em;
13
+
14
+ .with-variables {
15
+ height: @x + @y; // 16em
16
+ width: 12 + @y; // 24em
17
+ size: 5cm - @x; // 1cm
18
+ }
19
+
20
+ @z: -2;
21
+
22
+ .negative {
23
+ height: 2px + @z; // 0px
24
+ width: 2px - @z; // 4px
25
+ }
26
+
27
+ .shorthands {
28
+ padding: -1px 2px 0 -4px; //
29
+ }
30
+
31
+ .colors {
32
+ color: #123; // #112233
33
+ border-color: #234 + #111111; // #334455
34
+ background-color: #222222 - #fff; // #000000
35
+ .other {
36
+ color: 2 * #111; // #222222
37
+ border-color: #333333 / 3 + #111; // #222222
38
+ }
39
+ }