From 93f68c859585439ea35ea2722574a9e55e69d4ff Mon Sep 17 00:00:00 2001 From: Anton Ignatov Date: Wed, 12 Mar 2014 12:01:14 +0300 Subject: [PATCH 1/2] Added @font-face support --- lib/identity.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/identity.js b/lib/identity.js index cc9fd5c..47af488 100644 --- a/lib/identity.js +++ b/lib/identity.js @@ -1,4 +1,3 @@ - /** * Module dependencies. */ @@ -174,6 +173,22 @@ Compiler.prototype.page = function(node){ + this.emit('\n}'); }; +/** + * Visit font-face node. + */ + +Compiler.prototype.fontface = function(node){ + var decls = node.declarations; + if (!decls.length) return ''; + + return this.emit('@font-face ') + + this.emit('{\n') + + this.emit(this.indent(1)) + + this.mapVisit(decls, '\n') + + this.emit(this.indent(-1)) + + this.emit('\n}'); +}; + /** * Visit rule node. */ From 07e6720e1bd69de285878dc2a92d0f32c5e0a316 Mon Sep 17 00:00:00 2001 From: Anton Ignatov Date: Wed, 12 Mar 2014 12:01:38 +0300 Subject: [PATCH 2/2] Added @font-face support --- lib/compress.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/compress.js b/lib/compress.js index 601bd73..0837e24 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -1,4 +1,3 @@ - /** * Module dependencies. */ @@ -144,6 +143,17 @@ Compiler.prototype.page = function(node){ + this.emit('}'); }; +/** + * Visit font-face node. + */ + +Compiler.prototype.fontface = function(node){ + return this.emit('@font-face ') + + this.emit('{') + + this.mapVisit(node.declarations) + + this.emit('}'); +}; + /** * Visit rule node. */