File tree Expand file tree Collapse file tree 3 files changed +44
-5
lines changed
Expand file tree Collapse file tree 3 files changed +44
-5
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ module.exports = function(css){
1414 function stylesheet ( ) {
1515 var rules = [ ] ;
1616 var node ;
17+ whitespace ( ) ;
1718 comments ( ) ;
1819 while ( node = atrule ( ) || rule ( ) ) {
1920 comments ( ) ;
@@ -177,12 +178,23 @@ module.exports = function(css){
177178 return decls ;
178179 }
179180
180- /**
181- * Parse at rule.
182- */
183-
181+ /**
182+ * Parse import
183+ */
184+
185+ function atimport ( ) {
186+ var m = match ( / ^ @ i m p o r t * ( [ ^ ; \n ] + ) ; \s * / ) ;
187+ if ( ! m ) return ;
188+ return { import : m [ 1 ] } ;
189+ }
190+
191+ /**
192+ * Parse at rule.
193+ */
194+
184195 function atrule ( ) {
185- return keyframes ( ) ;
196+ return keyframes ( )
197+ || atimport ( ) ;
186198 }
187 199
188200 /**
Original file line number Diff line number Diff line change 1+
2+ @import url ("fineprint.css" ) print;
3+ @import url ("bluish.css" ) projection, tv;
4+ @import 'custom.css' ;
5+ @import "common.css" screen, projection;
6+ @import url ('landscape.css' ) screen and (orientation : landscape);
Original file line number Diff line number Diff line change 1+ {
2+ "stylesheet" : {
3+ "rules" : [
4+ {
5+ "import" : " url(\" fineprint.css\" ) print"
6+ },
7+ {
8+ "import" : " url(\" bluish.css\" ) projection, tv"
9+ },
10+ {
11+ "import" : " 'custom.css'"
12+ },
13+ {
14+ "import" : " \" common.css\" screen, projection"
15+ },
16+ {
17+ "import" : " url('landscape.css') screen and (orientation:landscape)"
18+ }
19+ ]
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments