JSPM

css-selectors-count

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 262
  • Score
    100M100P100Q89573F
  • License MIT

Ensure your CSS won't be discarded by IE 9 and below because of crazy stylesheets limitation of legacy IE.

Package Exports

  • css-selectors-count

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (css-selectors-count) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

css-selector-count Build Status npm version

Count selectors in your CSS file in order to make sure it don't exceed the limitation of legacy IE browsers.

Usage

var csc = require('css-selectors-count');
var fs = require('fs');

fs.readFile('style.css', {encoding: 'utf8'}, function(err, file) {
  if(err) throw err;
  console.log(csc(file)); // return a object like { rules: 1, selectors: 10}
});

Scripts

$ npm run test
$ npm run coverage

License

MIT