Files
postcss/lib/comment.js
T
2014-07-03 01:05:06 +09:00

24 lines
547 B
JavaScript

var Node = require('./node');
// CSS comment between declarations or rules
class Comment extends Node {
constructor(defaults) {
this.type = 'comment';
super(defaults);
}
// Default spaces for new node
defaultStyle() {
return { left: ' ', right: ' ' };
}
// Stringify declaration
stringify(builder) {
var style = this.style();
if ( this.before ) builder(this.before);
builder('/*' + style.left + this.text + style.right + '*/', this);
}
}
module.exports = Comment;