How to use the cssom.CSSKeyframesRule function in cssom

To help you get started, we’ve selected a few cssom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github iazrael / ispriter / src / ispriter.js View on Github external
var styleSheet = readStyleSheet(url);
            debug('read import style: ' + url + ' , has styleSheet == : ' + !!styleSheet);
            if (!styleSheet) {
                return;
            }
            rule.styleSheet = styleSheet;

            debug('collect import style: ' + fileName);

            // 继续收集 import 的样式
            collectStyleRules(styleSheet, result, url);
            return;
        }

        if (rule.cssRules && rule.cssRules.length) {
            if (rule instanceof CSSOM.CSSKeyframesRule) {
                return; // FIXME 先跳过 keyframes 的属性
            }

            // 遇到有子样式的,比如 @media, 递归收集
            collectStyleRules(rule, result, styleSheetUrl);
            return;
        }

        if (!rule.style) {

            // 有可能 @media 等中没有任何样式, 如: @media xxx {}
            return;
        }

        /* 
         * typeof style === 'CSSStyleDeclaration'
github iazrael / ispriter / lib / BaseStyleSheet.js View on Github external
if(!styleSheet){
                return;
            }
            rule.styleSheet = styleSheet;
            
            Logger.debug('collect import style: ' + fileName);

            // 继续收集 import 的样式
            collectStyleRules(styleSheet, result, cssUri);
            return;
        }

        if(rule.cssRules && rule.cssRules.length){

            if(rule instanceof CSSOM.CSSKeyframesRule){

                return; // FIXME 先跳过 keyframes 的属性
            }

            // 遇到有子样式的,比如 @media, 递归收集
            collectStyleRules(rule, result, styleSheetUri);
            return;
        }

        if(!rule.style){

            // 有可能 @media 等中没有任何样式, 如: @media xxx {}
            return;
        }

        /* 
github iazrael / ispriter / lib / ispriter.js View on Github external
var styleSheet = readStyleSheet(url);
            debug('read import style: ' + url + ' , has styleSheet == : ' + !!styleSheet);
            if(!styleSheet){
                return;
            }
            rule.styleSheet = styleSheet;
            
            debug('collect import style: ' + fileName);

            // 继续收集 import 的样式
            collectStyleRules(styleSheet, result, url);
            return;
        }

        if(rule.cssRules && rule.cssRules.length){
            if(rule instanceof CSSOM.CSSKeyframesRule){
                return; // FIXME 先跳过 keyframes 的属性
            }

            // 遇到有子样式的,比如 @media, 递归收集
            collectStyleRules(rule, result, styleSheetUrl);
            return;
        }

        if(!rule.style){

            // 有可能 @media 等中没有任何样式, 如: @media xxx {}
            return;
        }

        /* 
         * typeof style === 'CSSStyleDeclaration'