File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Expand file tree Collapse file tree 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) {
3939 var /*match*/ key = _matches2 [ 1 ] ;
4040 var value = _matches2 [ 2 ] ;
4141
42+ // Values can refer to each other
43+ if ( definitions [ value ] ) value = definitions [ value ] ;
4244 definitions [ key ] = value ;
4345 atRule . remove ( ) ;
4446 }
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ export default css => {
1616 let matches
1717 while ( matches = matchLet . exec ( atRule . params ) ) {
1818 let [ /*match*/ , key , value ] = matches
19+ // Values can refer to each other
20+ if ( definitions [ value ] ) value = definitions [ value ]
1921 definitions [ key ] = value
2022 atRule . remove ( )
2123 }
Original file line number Diff line number Diff line change @@ -71,5 +71,12 @@ describe('constants', () => {
7171 ':import(colors) {\n i__const_red_6: red\n}'
7272 )
7373 } )
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+ } )
7481} )
7582
You can’t perform that action at this time.
0 commit comments