The CSSRule interface represents a single CSS rule.

MDN Reference

interface CSSRule {
    CHARSET_RULE: 2;
    COUNTER_STYLE_RULE: 11;
    cssText: string;
    FONT_FACE_RULE: 5;
    FONT_FEATURE_VALUES_RULE: 14;
    IMPORT_RULE: 3;
    KEYFRAME_RULE: 8;
    KEYFRAMES_RULE: 7;
    MEDIA_RULE: 4;
    NAMESPACE_RULE: 10;
    PAGE_RULE: 6;
    parentRule: CSSRule | null;
    parentStyleSheet: CSSStyleSheet | null;
    STYLE_RULE: 1;
    SUPPORTS_RULE: 12;
    type: number;
}
Index

Properties

CHARSET_RULE: 2
COUNTER_STYLE_RULE: 11
cssText: string

The cssText property of the CSSRule interface returns the actual text of a CSSStyleSheet style-rule.

MDN Reference

FONT_FACE_RULE: 5
FONT_FEATURE_VALUES_RULE: 14
IMPORT_RULE: 3
KEYFRAME_RULE: 8
KEYFRAMES_RULE: 7
MEDIA_RULE: 4
NAMESPACE_RULE: 10
PAGE_RULE: 6
parentRule: CSSRule | null

The parentRule property of the CSSRule interface returns the containing rule of the current rule if this exists, or otherwise returns null.

MDN Reference

parentStyleSheet: CSSStyleSheet | null

The parentStyleSheet property of the the current rule is defined.

MDN Reference

STYLE_RULE: 1
SUPPORTS_RULE: 12
type: number

The read-only type property of the indicating which type of rule the CSSRule represents.

MDN Reference