Chartbreaker
    Preparing search index...

    Interface CSSStyleSheet

    The CSSStyleSheet interface represents a single CSS stylesheet, and lets you inspect and modify the list of rules contained in the stylesheet.

    MDN Reference

    interface CSSStyleSheet {
        cssRules: CSSRuleList;
        disabled: boolean;
        href: null | string;
        ownerNode: null | Element | ProcessingInstruction;
        ownerRule: null | CSSRule;
        parentStyleSheet: null | CSSStyleSheet;
        rules: CSSRuleList;
        title: null | string;
        type: string;
        get media(): MediaList;
        set media(mediaText: string): void;
        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 Summary)

    Index

    Properties

    cssRules: CSSRuleList

    The read-only CSSStyleSheet property cssRules returns a live CSSRuleList which provides a real-time, up-to-date list of every CSS rule which comprises the stylesheet.

    MDN Reference

    disabled: boolean

    The disabled property of the applying to the document.

    MDN Reference

    href: null | string

    The href property of the StyleSheet interface returns the location of the style sheet.

    MDN Reference

    ownerNode: null | Element | ProcessingInstruction

    The ownerNode property of the with the document.

    MDN Reference

    ownerRule: null | CSSRule
    parentStyleSheet: null | CSSStyleSheet

    The parentStyleSheet property of the the given style sheet.

    MDN Reference

    rules: CSSRuleList

    rules is a deprecated legacy property of the CSSStyleSheet interface.

    MDN Reference

    title: null | string

    The title property of the StyleSheet interface returns the advisory title of the current style sheet.

    MDN Reference

    type: string

    The type property of the StyleSheet interface specifies the style sheet language for the given style sheet.

    MDN Reference

    Accessors

    • get media(): MediaList

      The media property of the StyleSheet interface specifies the intended destination media for style information.

      MDN Reference

      Returns MediaList

    • set media(mediaText: string): void

      Parameters

      • mediaText: string

      Returns void

    Methods

    • The obsolete CSSStyleSheet interface's addRule() legacy method adds a new rule to the stylesheet.

      Parameters

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

      Returns number

      MDN Reference

    • The CSSStyleSheet method deleteRule() removes a rule from the stylesheet object.

      MDN Reference

      Parameters

      • index: number

      Returns void

    • The CSSStyleSheet.insertRule() method inserts a new CSS rule into the current style sheet.

      MDN Reference

      Parameters

      • rule: string
      • Optionalindex: number

      Returns number

    • The obsolete CSSStyleSheet method removeRule() removes a rule from the stylesheet object.

      Parameters

      • Optionalindex: number

      Returns void

      MDN Reference

    • The replace() method of the CSSStyleSheet interface asynchronously replaces the content of the stylesheet with the content passed into it.

      MDN Reference

      Parameters

      • text: string

      Returns Promise<CSSStyleSheet>

    • The replaceSync() method of the CSSStyleSheet interface synchronously replaces the content of the stylesheet with the content passed into it.

      MDN Reference

      Parameters

      • text: string

      Returns void