import { default } from "https://deno.land/x/postcss@8.4.16/lib/rule.d.ts";
Represents a CSS rule: a selector followed by a declaration block.
Once (root, { Rule }) {
let a = new Rule({ selector: 'a' })
a.append(…)
root.append(a)
}
const root = postcss.parse('a{}')
const rule = root.first
rule.type //=> 'rule'
rule.toString() //=> 'a{}'
Properties
The rule’s full selector represented as a string.
const root = postcss.parse('a, b { }')
const rule = root.first
rule.selector //=> 'a, b'
An array containing the rule’s individual selectors. Groups of selectors are split at commas.
const root = postcss.parse('a, b { }')
const rule = root.first
rule.selector //=> 'a, b'
rule.selectors //=> ['a', 'b']
rule.selectors = ['a', 'strong']
rule.selector //=> 'a, strong'
Methods
assign(overrides: object | RuleProps): this
clone(overrides?: Partial<RuleProps>): this
cloneAfter(overrides?: Partial<RuleProps>): this
cloneBefore(overrides?: Partial<RuleProps>): this