Interface CSSStyleSheet

A single CSS style sheet. It inherits properties and methods from its parent, StyleSheet.

MDN Reference

interface CSSStyleSheet {
    cssRules: CSSRuleList;
    disabled: boolean;
    href: null | string;
    media: MediaList;
    ownerNode: null | Element | ProcessingInstruction;
    ownerRule: null | CSSRule;
    parentStyleSheet: null | CSSStyleSheet;
    rules: CSSRuleList;
    title: null | string;
    type: string;
    addRule(selector?: string, style?: string, index?: number): number;
    deleteRule(index: number): void;
    insertRule(rule: string, index?: number): number;
    removeRule(index?: number): void;
    replace(text: string): Promise<CSSStyleSheet>;
    replaceSync(text: string): void;
}

Hierarchy (view full)

Properties

cssRules: CSSRuleList
disabled: boolean
href: null | string
media: MediaList
ownerNode: null | Element | ProcessingInstruction
ownerRule: null | CSSRule
parentStyleSheet: null | CSSStyleSheet
rules: CSSRuleList

MDN Reference

title: null | string
type: string

Methods

  • Parameters

    • Optionalselector: string
    • Optionalstyle: string
    • Optionalindex: number

    Returns number

    MDN Reference

  • Parameters

    • index: number

    Returns void

  • Parameters

    • rule: string
    • Optionalindex: number

    Returns number

  • Parameters

    • Optionalindex: number

    Returns void

    MDN Reference

  • Parameters

    • text: string

    Returns Promise<CSSStyleSheet>

  • Parameters

    • text: string

    Returns void