Lint CSS for browser support against the caniuse database. Version 6.0.0 is current stable, released on npm. It integrates as a PostCSS plugin, CLI tool, and transform stream. Differentiators: uses actual caniuse data, supports ignore lists by feature or file globs, outputs human-readable or JSON messages, and works with Stylelint. Alternatives like Autoprefixer add prefixes rather than warn on unsupported features.
npm install doiuse2No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates using doiuse2 as a PostCSS plugin to check CSS against browser support, with ignore options and event handler.
Use new DoIUse({ browsers: ['ie >= 9'] }) instead of doiuse({ browsers: 'ie >= 9' }).Install 'doiuse2' and update imports to 'doiuse2/...'.
Create a .browserslistrc in your project root instead of passing --browsers.
Use var doiuse = require('doiuse'); /* no new */Check the features list at https://github.com/clshortfuse/doiuse2/blob/master/data/features.js for valid ignore values.
npm install doiuse2 and import from 'doiuse2/lib/DoIUse.js'.
Use require('doiuse') directly as a function: postcss([doiuse(opts)]).Supply browsers option (array of strings) or a .browserslistrc file.
Refer to the features list in data/features.js for valid names.