type property
int
get
type
The read-only type
property of the
CSSRule interface is a deprecated property that returns an integer
indicating which type of rule the CSSRule represents.
If you need to distinguish different types of CSS rule, a good alternative
is to use
constructor.name
:
const sheets = Array.from(document.styleSheets);
const rules = sheets.map((sheet) => Array.from(sheet.cssRules)).flat();
for (const rule of rules) {
console.log(rule.constructor.name);
}
Implementation
external int get type;