diff --git a/lib/stringify/compress.js b/lib/stringify/compress.js index 929b4a21..7c0b8dfb 100644 --- a/lib/stringify/compress.js +++ b/lib/stringify/compress.js @@ -180,8 +180,9 @@ Compiler.prototype['custom-media'] = function(node){ */ Compiler.prototype.rule = function(node){ + if (!node.selectors.length) { return ''; } var decls = node.declarations; - if (!decls.length) return ''; + if (!decls.length) decls = ''; return this.emit(node.selectors.join(','), node.position) + this.emit('{') diff --git a/lib/stringify/identity.js b/lib/stringify/identity.js index b390c91e..e10768ed 100644 --- a/lib/stringify/identity.js +++ b/lib/stringify/identity.js @@ -216,9 +216,10 @@ Compiler.prototype['custom-media'] = function(node){ */ Compiler.prototype.rule = function(node){ + if (!node.selectors.length) { return ''; } var indent = this.indent(); var decls = node.declarations; - if (!decls.length) return ''; + if (!decls.length) decls = ''; return this.emit(node.selectors.map(function(s){ return indent + s }).join(',\n'), node.position) + this.emit(' {\n')