mirror of
https://github.com/hanzoai/postcss.git
synced 2026-09-24 17:01:56 +00:00
27 lines
618 B
JavaScript
27 lines
618 B
JavaScript
var Node = require('./node');
|
|
|
|
// CSS comment between declarations or rules
|
|
class Comment extends Node {
|
|
constructor(defaults) {
|
|
this.type = 'comment';
|
|
super(defaults);
|
|
}
|
|
|
|
styleMap() {
|
|
return {
|
|
commentLeft: this.left,
|
|
commentRight: this.right
|
|
};
|
|
}
|
|
|
|
// Stringify declaration
|
|
stringify(builder) {
|
|
if ( this.before ) builder(this.before);
|
|
var left = this.style('commentLeft');
|
|
var right = this.style('commentRight');
|
|
builder('/*' + left + this.text + right + '*/', this);
|
|
}
|
|
}
|
|
|
|
module.exports = Comment;
|