File tree Expand file tree Collapse file tree 1 file changed +6
-34
lines changed Expand file tree Collapse file tree 1 file changed +6
-34
lines changed Original file line number Diff line number Diff line change @@ -437,50 +437,22 @@ module.exports = function(css, options){
437
437
function atfontface ( ) {
438
438
var pos = position ( ) ;
439
439
var m = match ( / ^ @ f o n t - f a c e * / ) ;
440
- var re = / u r l \( [ ' " ] ( [ ^ ' " ] + ) [ ' " ] \) \s * (?: f o r m a t \( [ ' " ] ( [ ^ ' " ] + ) [ ' " ] \) ) ? / i;
441
- var src = [ ] ;
442
- var decls = [ ] ;
443
- var srcList ;
444
440
445
441
if ( ! m ) return ;
446
-
447
442
if ( ! open ( ) ) return error ( "@font-face missing '{'" ) ;
443
+ var decls = comments ( ) ;
448
444
449
- var name = match ( / ^ f o n t - f a m i l y \s * : \s * [ ' " ] ( [ ^ ' " ] + ) [ ' " ] ; / ) ;
450
-
451
- if ( ! name ) return error ( "@font-face missing 'font-family'" ) ;
452
- decls . push ( {
453
- type : 'declaration' ,
454
- property : 'font-family' ,
455
- value : trim ( name [ 1 ] )
456
- } )
457
- whitespace ( ) ;
458
-
459
- while ( srcList = match ( / ^ s r c \s * : \s * ( [ ^ ; ] + ) ; / ) ) {
460
- var val = trim ( srcList [ 1 ] ) ;
461
- var set = val . split ( ',' ) ;
462
-
463
- decls . push ( {
464
- type : 'declaration' ,
465
- property : 'src' ,
466
- value : val
467
- } ) ;
468
-
469
- set . forEach ( function ( item ) {
470
- m = re . exec ( item ) ;
471
- src . push ( {
472
- url : trim ( m [ 1 ] ) ,
473
- format : trim ( m [ 2 ] )
474
- } ) ;
475
- } )
476
- whitespace ( ) ;
445
+ // declarations
446
+ var decl ;
447
+ while ( decl = declaration ( ) ) {
448
+ decls . push ( decl ) ;
449
+ decls = decls . concat ( comments ( ) ) ;
477
450
}
478
451
479
452
if ( ! close ( ) ) return error ( "@font-face missing '}'" ) ;
480
453
481
454
return pos ( {
482
455
type : 'fontface' ,
483
- src : src ,
484
456
declarations : decls
485
457
} ) ;
486
458
}
You can’t perform that action at this time.
0 commit comments