The CSSStyleSheet interface represents a single CSS stylesheet, and lets you inspect and modify the list of rules contained in the stylesheet. It inherits properties and methods from its parent, StyleSheet.
A stylesheet consists of a collection of CSSRule objects representing each of the rules in the stylesheet. The rules are contained in a CSSRuleList, which can be obtained from the stylesheet's cssRules property.
For example, one rule might be a CSSStyleRule object containing a style such as:
Another rule might be an at-rule such as @import or @media, and so forth.
Functionally identical to deleteRule(); removes the rule at the specified index from the stylesheet's rule list.
Obtaining a StyleSheet
A stylesheet is associated with at most one Document, which it applies to (unless disabled). A list of CSSStyleSheet objects for a given document can be obtained using the Document.styleSheets property. A specific style sheet can also be accessed from its owner object (Node or CSSImportRule), if any.
A CSSStyleSheet object is created and inserted into the document's Document.styleSheets list automatically by the browser, when a stylesheet is loaded for a document.
A (possibly incomplete) list of ways a stylesheet can be associated with a document follows:
Reason for the style sheet to be associated with the document
Appears in document. styleSheets list
Getting the owner element/rule given the style sheet object