mirror of
https://github.com/hanzoai/postcss.git
synced 2026-09-24 17:01:56 +00:00
28 lines
620 B
JavaScript
28 lines
620 B
JavaScript
import Declaration from './declaration';
|
|
import Container from './container';
|
|
import list from './list';
|
|
|
|
// CSS rule like “a { }”
|
|
export default class Rule extends Container {
|
|
constructor(defaults) {
|
|
this.type = 'rule';
|
|
this.nodes = [];
|
|
super(defaults);
|
|
}
|
|
|
|
// Shortcut to get selectors as array
|
|
|
|
get selectors() {
|
|
return list.comma(this.selector);
|
|
}
|
|
|
|
set selectors(values) {
|
|
this.selector = values.join(', ');
|
|
}
|
|
|
|
// Stringify rule
|
|
stringify(builder) {
|
|
this.stringifyBlock(builder, this.stringifyRaw('selector'));
|
|
}
|
|
}
|