mirror of
https://github.com/hanzoai/postcss.git
synced 2026-09-24 17:01:56 +00:00
24 lines
588 B
JavaScript
24 lines
588 B
JavaScript
import Node from './node';
|
|
|
|
export default class Declaration extends Node {
|
|
constructor(defaults) {
|
|
super(defaults);
|
|
this.type = 'decl';
|
|
}
|
|
|
|
stringify(builder, semicolon) {
|
|
let before = this.style('before');
|
|
if ( before ) builder(before);
|
|
|
|
let between = this.style('between', 'colon');
|
|
let string = this.prop + between + this.stringifyRaw('value');
|
|
|
|
if ( this.important ) {
|
|
string += this._important || ' !important';
|
|
}
|
|
|
|
if ( semicolon ) string += ';';
|
|
builder(string, this);
|
|
}
|
|
}
|