![]()
Cross browser function to add a CSSRule into a CSSStyleSheet, optionally
at a given index.
Arguments:
|
code » | |||||
Appends a DOM node to HEAD containing the css text that's passed in.
|
code » | |||||
Recursively gets all CSSStyleRules, optionally starting from a given
CSSStyleSheet.
Note that this excludes any CSSImportRules, CSSMediaRules, etc..
Arguments:
Returns: Array.<CSSStyleRule>
A list of CSSStyleRules.
|
code » | |||||
Gets all CSSStyleSheet objects starting from some CSSStyleSheet. Note that we
want to return the sheets in the order of the cascade, therefore if we
encounter an import, we will splice that CSSStyleSheet object in front of
the CSSStyleSheet that contains it in the returned array of CSSStyleSheets.
Arguments:
|
code » | |||||
Recursively gets all CSS as text, optionally starting from a given
CSSStyleSheet.
Arguments:
Returns: string
css text.
|
code » | |||||
Recursively gets all CSS text or rules.
|
code » | |||||
Get the index of the CSSRule in it's CSSStyleSheet.
Arguments:
Returns: number
The index of the CSSRule, or -1.
|
code » | |||||
![]()
Returns the CSSRules from a styleSheet.
Worth noting here is that IE and FF differ in terms of what they will return.
Firefox will return styleSheet.cssRules, which includes ImportRules and
anything which implements the CSSRules interface. IE returns simply a list of
CSSRules.
Arguments:
Returns: CSSRuleList
An array of CSSRules or null.
|
code » | |||||
Gets the cssText from a CSSRule object cross-browserly.
Arguments:
Returns: string
cssText The text for the rule, including the selector.
|
code » | |||||
Cross browser method to get the filename from the StyleSheet's href.
Explorer only returns the filename in the href, while other agents return
the full path.
Arguments:
Returns: ?string
filename The filename, or null if not an external
styleSheet.
|
code » | |||||
![]()
We do some trickery in getAllCssStyleRules that hacks this in for IE.
If the cssRule object isn't coming from a result of that function call, this
method will return undefined in IE.
Arguments:
Returns: CSSStyleSheet
A styleSheet object.
|
code » | |||||
![]()
Cross browser function to remove a CSSRule in a CSSStyleSheet at an index.
Arguments:
|
code » | |||||
![]()
Replace a cssRule with some cssText for a new rule.
If the cssRule object is not one of objects returned by
getAllCssStyleRules, then you'll need to provide both the styleSheet and
possibly the index, since we can't infer them from the standard cssRule
object in IE. We do some trickery in getAllCssStyleRules to hack this in.
Arguments:
|
code » |