File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 11const matchImports = / ^ ( .+ ?) \s + f r o m \s + (?: " ( [ ^ " ] + ) " | ' ( [ ^ ' ] + ) ' ) $ /
2+ const matchLet = / (?: , \s + | ^ ) ( [ \w - ] + ) : ? \s + ( " [ ^ " ] * " | ' [ ^ ' ] * ' | [ ^ , ] + ) \s ? / g
23
34export default css => {
4- css . eachAtRule ( 'alias' , atRule => {
5+ let declarations = { }
6+ css . eachAtRule ( / ^ - ? l e t $ / , atRule => {
7+ console . log ( atRule . params )
8+
9+ let matches
10+ while ( matches = matchLet . exec ( atRule . params ) ) {
11+ let [ /*match*/ , key , value ] = matches
12+ declarations [ key ] = value
13+ }
14+ } )
15+ css . eachAtRule ( / ^ - ? i m p o r t $ / , atRule => {
516 let imports = matchImports . exec ( atRule . params )
617 if ( imports ) {
7-
18+ //console.log(imports)
819 } else {
920 console . log ( atRule . params )
1021 }
Original file line number Diff line number Diff line change 1- @let borders: "./borders.css" ;
2- @import small from "./ breakpoints.css" ;
1+ @let borders: "./borders.css" , breakpoints : "./breakpoints" ;
2+ @import small from breakpoints;
33@import secondary, blue as primary from "./colors.css" ;
44
55.foo {
You can’t perform that action at this time.
0 commit comments