Skip to content

Commit

Permalink
Fix @font-face issue
Browse files Browse the repository at this point in the history
- `css-parse` didn't support @font-face before 2.0
  –> fixed
  • Loading branch information
pakastin committed Feb 27, 2018
1 parent a4eb8e3 commit ab831e7
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/convert/css.js
Expand Up @@ -75,6 +75,8 @@ Converter.prototype.visit = function(node){
case 'supports':
var name = node.type[0].toUpperCase() + node.type.slice(1);
return this['visit' + name](node);
case 'font-face':
return this.visitFontFace(node);
}
};

Expand All @@ -94,6 +96,25 @@ Converter.prototype.visitRules = function(node){
return buf;
};

/**
* Visit FontFace `node`.
*
* @param {FontFace} node
* @return {String}
* @api private
*/

Converter.prototype.visitFontFace = function(node){
var buf = this.indent + '@font-face';
buf += '\n';
++this.indents;
for (var i = 0, len = node.declarations.length; i < len; ++i) {
buf += this.visitDeclaration(node.declarations[i]);
}
--this.indents;
return buf;
};

/**
* Visit Media `node`.
*
Expand Down

0 comments on commit ab831e7

Please sign in to comment.