StyleSheet
Types
cssRule
A single CSS rule. There are several types of rules, listed in the Type constants section below. See CSSRule on MDN
type cssRule = { mutable cssText: string, parentRule: Null.t<cssRule>, parentStyleSheet: Null.t<cssStyleSheet>,}Record fields
cssRuleList
A CSSRuleList is an (indirect-modify only) array-like object containing an ordered collection of CSSRule objects. See CSSRuleList on MDN
type cssRuleList = private {length: int}Record fields
cssStyleSheet
A single CSS style sheet. It inherits properties and methods from its parent, StyleSheet. See CSSStyleSheet on MDN TODO: mark as private once mutating fields of private records is allowed
type cssStyleSheet = { type_: string, href: Null.t<string>, ownerNode: Null.t<unknown>, parentStyleSheet: Null.t<cssStyleSheet>, title: Null.t<string>, media: WebAPI.MediaList.t, mutable disabled: bool, ownerRule: Null.t<cssRule>, cssRules: cssRuleList,}Record fields
init
type init = { mutable baseURL?: string, mutable media?: unknown, mutable disabled?: bool,}Record fields
baseURL
option<string>
media
option<unknown>
disabled
option<bool>
t
A single style sheet. CSS style sheets will further implement the more specialized CSSStyleSheet interface. See StyleSheet on MDN
type t = { type_: string, href: Null.t<string>, ownerNode: Null.t<unknown>, parentStyleSheet: Null.t<cssStyleSheet>, title: Null.t<string>, media: WebAPI.MediaList.t, mutable disabled: bool,}Record fields
Values
deleteRule
let deleteRule: (cssStyleSheet, int) => unitinsertRule
let insertRule: (cssStyleSheet, ~rule: string, ~index: int=?) => intmake
let make: (~options: init=?) => cssStyleSheetreplace
let replace: (cssStyleSheet, string) => promise<cssStyleSheet>replaceSync
let replaceSync: (cssStyleSheet, string) => unit