File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -200,10 +200,13 @@ module.exports = function(css){
200
200
* Parse import
201
201
*/
202
202
203
- function atimport ( ) {
204
- var m = match ( / ^ @ i m p o r t * ( [ ^ ; \n ] + ) ; \s * / ) ;
203
+ function atruleSimple ( ruleName ) {
204
+ var re = new RegExp ( '^@' + ruleName + ' *([^;\\n]+);\\s*' ) ;
205
+ var m = match ( re ) ;
205
206
if ( ! m ) return ;
206
- return { import : m [ 1 ] . trim ( ) } ;
207
+ var ret = { }
208
+ ret [ ruleName ] = m [ 1 ] . trim ( ) ;
209
+ return ret ;
207
210
}
208
211
209
212
/**
@@ -234,7 +237,8 @@ module.exports = function(css){
234
237
function atrule ( ) {
235
238
return keyframes ( )
236
239
|| media ( )
237
- || atimport ( ) ;
240
+ || atruleSimple ( 'import' )
241
+ || atruleSimple ( 'charset' )
238
242
}
239
243
240
244
/**
@@ -249,4 +253,4 @@ module.exports = function(css){
249
253
}
250
254
251
255
return stylesheet ( ) ;
252
- } ;
256
+ } ;
You can’t perform that action at this time.
0 commit comments