Autoprefixer parses stylesheets and inserts vendor prefixes for rules based on Browserslist targets and current Can I Use support data.
Overview
Autoprefixer sits in asset pipelines as a PostCSS plugin so authors can write standard CSS while the tool adds -webkit-, -moz-, and other prefixes where still needed. Browser coverage comes from shared Browserslist configuration in package.json or .browserslistrc, keeping the same targets as Babel or Stylelint.
Beyond everyday properties, optional settings cover flexbox legacy modes, selective removal of outdated prefixes, and translated CSS Grid syntax for older Internet Explorer when explicitly enabled. Control comments can disable or limit processing per block, and the plugin surfaces warnings for obsolete gradient syntax or outdated flex display values.
Integrations span Gulp, Webpack, other bundlers, Ruby on Rails, CLI via postcss-cli, CSS-in-js loaders, and direct Node.js APIs, plus a standalone build for non-Node runtimes. It does not polyfill behaviors—only prefixes—so companion PostCSS presets handle broader future-CSS transforms.
An online interactive demo illustrates output, and maintenance is led by the PostCSS ecosystem with browser statistics refreshed through Browserslist queries.
Key features
- Prefixes driven by Can I Use and Browserslist
- Shared config with Babel and Stylelint tools
- Optional CSS Grid translations for legacy IE
- Flexbox and @supports prefix toggles
- Removes outdated prefixes when enabled
- Control comments to scope processing
- Warnings for deprecated CSS patterns
- Hooks for Gulp, Webpack, CLI, and Node
Use cases
- Front-end build pipelines targeting many browsers
- Legacy IE grid layouts behind explicit opt-in
- Keeping authored CSS free of vendor clutter
- Aligning autoprefix targets with transpiled JavaScript
- Batch processing CSS via PostCSS CLI