less 3.8.1 → 3.9.0

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.
@@ -40,9 +40,43 @@
40
40
  val2: 2;
41
41
  val3: 4;
42
42
  }
43
+ .column-list {
44
+ list: 1 2 3 4;
45
+ }
46
+ .col-1 {
47
+ width: 25%;
48
+ }
49
+ .col-2 {
50
+ width: 25%;
51
+ }
52
+ .col-3 {
53
+ width: 25%;
54
+ }
55
+ .col-4 {
56
+ width: 25%;
57
+ }
58
+ .row-1 {
59
+ width: 10px;
60
+ }
61
+ .row-2 {
62
+ width: 20px;
63
+ }
64
+ .row-3 {
65
+ width: 30px;
66
+ }
43
67
  .box {
44
68
  -less-log: a;
45
69
  -less-log: b;
46
70
  -less-log: c;
47
71
  -less-log: d;
48
72
  }
73
+ .test {
74
+ color: blue;
75
+ color: red;
76
+ }
77
+ .foo {
78
+ content: red;
79
+ }
80
+ .bar {
81
+ content: blue;
82
+ }
@@ -38,8 +38,11 @@ each(@selectors, {
38
38
 
39
39
  @set: {
40
40
  one: blue;
41
+ // skip comments
41
42
  two: green;
42
- three: red;
43
+ /** and these
44
+ */
45
+ three: red; //and this
43
46
  }
44
47
  .set {
45
48
  each(@set, {
@@ -73,9 +76,56 @@ each(@selectors, {
73
76
  });
74
77
  }
75
78
 
79
+ @columns: range(4);
80
+ .column-list {
81
+ list: @columns;
82
+ }
83
+
84
+ each(@columns, .(@val) {
85
+ .col-@{val} {
86
+ width: (100% / length(@columns));
87
+ }
88
+ });
89
+
90
+ each(range(10px, 30px, 10px), .(@val, @index) {
91
+ .row-@{index} {
92
+ width: @val;
93
+ }
94
+ });
95
+
76
96
  @list: a b c d;
77
97
  .box {
78
98
  each(@list, {
79
99
  -less-log: extract(@list, @index);
80
100
  })
81
101
  }
102
+
103
+ // https://github.com/less/less.js/issues/3325
104
+
105
+ @color-schemes: {
106
+ @primary: {
107
+ @color: blue;
108
+ }
109
+ @secondary: {
110
+ @color: red;
111
+ }
112
+ }
113
+ .test {
114
+ each(primary secondary, .(@color-name) {
115
+ @scheme: @color-schemes[@@color-name]; // e.g. @color-name = primary
116
+ color: @scheme[@color];
117
+ });
118
+ }
119
+
120
+ @one: {
121
+ @two: {
122
+ foo: red;
123
+ bar: blue;
124
+ };
125
+ };
126
+
127
+ each(@one[@two], {
128
+ .@{key} {
129
+ content: @value;
130
+ }
131
+ });
@@ -38,8 +38,11 @@ each(@selectors, {
38
38
 
39
39
  @set: {
40
40
  one: blue;
41
+ // skip comments
41
42
  two: green;
42
- three: red;
43
+ /** and these
44
+ */
45
+ three: red; //and this
43
46
  }
44
47
  .set {
45
48
  each(@set, {
@@ -73,9 +76,56 @@ each(@selectors, {
73
76
  });
74
77
  }
75
78
 
79
+ @columns: range(4);
80
+ .column-list {
81
+ list: @columns;
82
+ }
83
+
84
+ each(@columns, .(@val) {
85
+ .col-@{val} {
86
+ width: (100% / length(@columns));
87
+ }
88
+ });
89
+
90
+ each(range(10px, 30px, 10px), .(@val, @index) {
91
+ .row-@{index} {
92
+ width: @val;
93
+ }
94
+ });
95
+
76
96
  @list: a b c d;
77
97
  .box {
78
98
  each(@list, {
79
99
  -less-log: extract(@list, @index);
80
100
  })
81
101
  }
102
+
103
+ // https://github.com/less/less.js/issues/3325
104
+
105
+ @color-schemes: {
106
+ @primary: {
107
+ @color: blue;
108
+ }
109
+ @secondary: {
110
+ @color: red;
111
+ }
112
+ }
113
+ .test {
114
+ each(primary secondary, .(@color-name) {
115
+ @scheme: @color-schemes[@@color-name]; // e.g. @color-name = primary
116
+ color: @scheme[@color];
117
+ });
118
+ }
119
+
120
+ @one: {
121
+ @two: {
122
+ foo: red;
123
+ bar: blue;
124
+ };
125
+ };
126
+
127
+ each(@one[@two], {
128
+ .@{key} {
129
+ content: @value;
130
+ }
131
+ });