How to use the csso.cleanInfo function in csso

To help you get started, we’ve selected a few csso 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 basisjs / basisjs / tools / build / build.js View on Github external
injection.unshift([{}, 's', '\n']);
                injection.push([{}, 's', '\n']);
                injection = [
                  [{}, 'atruler',
                    [{}, 'atkeyword',
                      [{}, 'ident', 'media' ]
                    ],
                    [{}, 'atrulerq'].concat(media),
                    [{}, 'atrulers'].concat(injection)
                  ]
                ];
              }

              // inject
              injection.unshift(i, 1,
                packCommentToken(csso.translate(csso.cleanInfo(token))),
                [{}, 's', '\n\n']
              );
              topToken.splice.apply(topToken, injection);
              i += injection.length - 2;
            }

            break;

          case 'simpleselector':
            var selectorTokens = token.slice(2);
            for (var j = 0, part; part = selectorTokens[j]; j++)
            {
              if (part[1] == 'clazz')
              {
                var ident = part[2];
                var identName = ident[2];
github basisjs / basisjs / tools / build / build.js View on Github external
cssFiles.forEach(function(cssFile){
      treeConsole.log(cssFile.basename);
      //content = csso.justDoIt(content);
      cssFile.content = csso.translate(csso.cleanInfo(csso.compress(cssFile.content)));
      treeConsole.log('  * ' + cssFile.sourceSize + ' -> ' + cssFile.content.length);
    });
github basisjs / basisjs / tools / build / build.js View on Github external
cssFiles.forEach(function(cssFile){
      cssFile.content = csso.translate(csso.cleanInfo(cssFile.content));
    });    
  }
github montagejs / mop / lib / transform / css.js View on Github external
}
            for (i = node.length - 1; i >= 0; i--) {
                if (Array.isArray(node[i])) {
                    worklist.push(node[i]);
                }
            }
        }
    }
    try {
        ast = CSSO.compress(ast);
    } catch (error) {
        config.out.warn("CSS compression error: ");
        config.out.warn(error.message);
    }
    try {
        ast = CSSO.cleanInfo(ast);
    } catch (error) {
        config.out.warn("CSS clean info error:");
        config.out.warn(error.message);
    }
    return CSSO.translate(ast);
}
github montagejs / mop / lib / transform / css.js View on Github external
for (var i = node.length - 1; i >= 0; i--) {
            if (Array.isArray(node[i])) {
                worklist.push(node[i]);
            }
        }
    }

    try {
        ast = CSSO.compress(ast);
    } catch (error) {
        config.out.warn("CSS compression error: " + file.path);
        config.out.warn(error.message);
    }

    try {
        ast = CSSO.cleanInfo(ast);
    } catch (error) {
        config.out.warn("CSS clean info error: " + file.path);
        config.out.warn(error.message);
    }

    return CSSO.translate(ast);
}

csso

CSS minifier with structural optimisations

MIT
Latest version published 2 years ago

Package Health Score

76 / 100
Full package analysis