Commit 76132ef 1 parent ef4baa5 commit 76132ef Copy full SHA for 76132ef
File tree 6 files changed +61
-7
lines changed
6 files changed +61
-7
lines changed Original file line number Diff line number Diff line change 3
3
" packages/*"
4
4
],
5
5
"npmClient" : " npm" ,
6
- "version" : " 3.12.1 "
6
+ "version" : " 3.12.2 "
7
7
}
Original file line number Diff line number Diff line change @@ -251,6 +251,7 @@ module.exports = function(grunt) {
251
251
command : [
252
252
// @TODO : make this more thorough
253
253
// CURRENT OPTIONS
254
+ `node bin/lessc --ie-compat ${ lessFolder } /_main/lazy-eval.less tmp/lazy-eval.css` ,
254
255
// --math
255
256
`node bin/lessc --math=always ${ lessFolder } /_main/lazy-eval.less tmp/lazy-eval.css` ,
256
257
`node bin/lessc --math=parens-division ${ lessFolder } /_main/lazy-eval.less tmp/lazy-eval.css` ,
Original file line number Diff line number Diff line change @@ -516,6 +516,10 @@ function processPluginQueue() {
516
516
}
517
517
518
518
break ;
519
+
520
+ case 'ie-compat' :
521
+ console . warn ( 'The --ie-compat option is deprecated, as it has no effect on compilation.' ) ;
522
+ break ;
519
523
520
524
case 'relative-urls' :
521
525
console . warn ( 'The --relative-urls option has been deprecated. Use --rewrite-urls=all.' ) ;
Original file line number Diff line number Diff line change 1
1
import Comment from '../tree/comment' ;
2
+ import Node from '../tree/node' ;
2
3
import Dimension from '../tree/dimension' ;
3
4
import Declaration from '../tree/declaration' ;
4
5
import Expression from '../tree/expression' ;
@@ -65,20 +66,27 @@ export default {
65
66
let newRules ;
66
67
let iterator ;
67
68
69
+ const tryEval = val => {
70
+ if ( val instanceof Node ) {
71
+ return val . eval ( this . context ) ;
72
+ }
73
+ return val ;
74
+ } ;
75
+
68
76
if ( list . value && ! ( list instanceof Quote ) ) {
69
77
if ( Array . isArray ( list . value ) ) {
70
- iterator = list . value ;
78
+ iterator = list . value . map ( tryEval ) ;
71
79
} else {
72
- iterator = [ list . value ] ;
80
+ iterator = [ tryEval ( list . value ) ] ;
73
81
}
74
82
} else if ( list . ruleset ) {
75
- iterator = list . ruleset . rules ;
83
+ iterator = tryEval ( list . ruleset ) . rules ;
76
84
} else if ( list . rules ) {
77
- iterator = list . rules ;
85
+ iterator = list . rules . map ( tryEval ) ;
78
86
} else if ( Array . isArray ( list ) ) {
79
- iterator = list ;
87
+ iterator = list . map ( tryEval ) ;
80
88
} else {
81
- iterator = [ list ] ;
89
+ iterator = [ tryEval ( list ) ] ;
82
90
}
83
91
84
92
let valueName = '@value' ;
Original file line number Diff line number Diff line change
1
+ : root {
2
+ --background-color : black;
3
+ --color : # fff ;
4
+ }
5
+ div {
6
+ display : inline-block;
7
+ padding : 1rem ;
8
+ background-color : var (--background-color );
9
+ color : var (--color );
10
+ }
Original file line number Diff line number Diff line change
1
+ // see: https://github.com/less/less.js/issues/3368
2
+ @vars : {
3
+ background-color : black ;
4
+ color : contrast ($background- color , #000 , #fff );
5
+ }
6
+
7
+ :root {
8
+ each(@vars , {
9
+ -- @{key} : @value ;
10
+ });
11
+ }
12
+
13
+ div {
14
+ display : inline-block ;
15
+ padding : 1rem ;
16
+ background-color : var (--background-color );
17
+ color : var (--color );
18
+ }
19
+
20
+ // see: https://github.com/less/less.js/issues/3339
21
+ // still fails - move to 4.0
22
+ // @components: {
23
+ // columns: true;
24
+ // ratios: false;
25
+ // };
26
+
27
+ // each(@components, {
28
+ // & when (@value = true) {
29
+ // @import (optional) "components/@{key}.less";
30
+ // }
31
+ // });
You can’t perform that action at this time.
0 commit comments