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

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;
}

层级 (查看完整内容)

属性

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

方法

  • 参数

    • 可选selector: string
    • 可选style: string
    • 可选index: number

    返回 number

  • 参数

    • index: number

    返回 void

  • 参数

    • rule: string
    • 可选index: number

    返回 number

  • 参数

    • 可选index: number

    返回 void

  • 参数

    • text: string

    返回 void