KeyframeKit / convertAllStyleSheetKeyframesRules
Function convertAllStyleSheetKeyframesRules()
ts
function convertAllStyleSheetKeyframesRules(obj: {
in: CSSStyleSheetSource;
}): ConvertedKeyframesRules;Gets all the CSS keyframes rules in a stylesheet or stylesheet list, then converts them to Web Animations API keyframes.
Parameters
obj
in
The style sheet or style sheet list to get keyframes from.
Returns
Throws
TypeError- Thrown if source is not a
CSSStyleSheetor aStyleSheetList.
- Thrown if source is not a
SecurityError- Thrown if source is a
CSSStyleSheetwhose rules can't be read (e.g. a cross-origin stylesheet loaded without CORS).
- Thrown if source is a
Remarks
- If multiple rules have the same name, the last one is used, like in CSS.
- When reading a
StyleSheetList, stylesheets whose rules can't be read are skipped. - Only top-level rules are read:
@keyframesrules nested in other rules (e.g.@media,@supportsor@layer) aren't found.