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 1
1
const matchImports = / ^ ( .+ ?) \s + f r o m \s + (?: " ( [ ^ " ] + ) " | ' ( [ ^ ' ] + ) ' ) $ /
2
+ const matchLet = / (?: , \s + | ^ ) ( [ \w - ] + ) : ? \s + ( " [ ^ " ] * " | ' [ ^ ' ] * ' | [ ^ , ] + ) \s ? / g
2
3
3
4
export 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 => {
5
16
let imports = matchImports . exec ( atRule . params )
6
17
if ( imports ) {
7
-
18
+ //console.log(imports)
8
19
} else {
9
20
console . log ( atRule . params )
10
21
}
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;
3
3
@import secondary, blue as primary from "./colors.css" ;
4
4
5
5
.foo {
You can’t perform that action at this time.
0 commit comments