File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module.exports = function(source) {
33 this . cacheable ( ) ;
44 var result = { } ;
55 css . parse ( source ) . stylesheet . rules
6- . filter ( rule => rule . selectors . some ( sel => sel === ':root' ) )
6+ . filter ( rule => rule . selectors && rule . selectors . some ( sel => sel === ':root' ) )
77 . forEach ( rule => rule . declarations
88 . filter ( decl => decl . type === 'declaration' && decl . property . indexOf ( '--' ) === 0 )
99 . forEach ( decl => result [ decl . property ] = decl . value ) ) ;
Original file line number Diff line number Diff line change @@ -33,3 +33,6 @@ check('should import from :root among multiple selectors',
3333check ( 'should not break when there is a comment' ,
3434 ':root { --theme: red; /* important info */ --accent: blue }' ,
3535 { '--accent' : 'blue' , '--theme' : 'red' } )
36+ check ( 'should not break when there is a file-level comment' ,
37+ '/* file info */ :root { --theme: red; /* important info */ --accent: blue }' ,
38+ { '--accent' : 'blue' , '--theme' : 'red' } )
You can’t perform that action at this time.
0 commit comments