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){
14
14
function stylesheet ( ) {
15
15
var rules = [ ] ;
16
16
var node ;
17
+ whitespace ( ) ;
17
18
comments ( ) ;
18
19
while ( node = atrule ( ) || rule ( ) ) {
19
20
comments ( ) ;
@@ -177,12 +178,23 @@ module.exports = function(css){
177
178
return decls ;
178
179
}
179
180
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
+
184
195
function atrule ( ) {
185
- return keyframes ( ) ;
196
+ return keyframes ( )
197
+ || atimport ( ) ;
186
198
}
187
199
188
200
/**
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