File tree 3 files changed +11
-0
lines changed 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,8 @@ exports['default'] = function (css) {
39
39
var /*match*/ key = _matches2 [ 1 ] ;
40
40
var value = _matches2 [ 2 ] ;
41
41
42
+ // Values can refer to each other
43
+ if ( definitions [ value ] ) value = definitions [ value ] ;
42
44
definitions [ key ] = value ;
43
45
atRule . remove ( ) ;
44
46
}
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ export default css => {
16
16
let matches
17
17
while ( matches = matchLet . exec ( atRule . params ) ) {
18
18
let [ /*match*/ , key , value ] = matches
19
+ // Values can refer to each other
20
+ if ( definitions [ value ] ) value = definitions [ value ]
19
21
definitions [ key ] = value
20
22
atRule . remove ( )
21
23
}
Original file line number Diff line number Diff line change @@ -71,5 +71,12 @@ describe('constants', () => {
71
71
':import(colors) {\n i__const_red_6: red\n}'
72
72
)
73
73
} )
74
+
75
+ it ( 'should allow transitive values' , ( ) => {
76
+ test (
77
+ '@value aaa: red;\n@value bbb: aaa;\n.a { color: bbb; }' ,
78
+ ':export {\n aaa: red;\n bbb: red;\n}\n.a { color: red; }'
79
+ )
80
+ } )
74
81
} )
75
82
You can’t perform that action at this time.
0 commit comments