mrkeyoor.com_
Sun 20 Sept 02:43 UTC
npmWeb Frontendupdated 19 Sept 2026

autoprefixer review

Autoprefixer 10.5.4 is a PostCSS plugin that rewrites CSS according to your Browserslist targets and current Can I Use data. It adds vendor-prefixed declarations that those browsers need and removes prefixes that have become obsolete. The 10.5 line added mask-position-x and mask-position-y handling, while 10.5.4 fixes a case that duplicated prefixed rules. It does not implement missing CSS features, and the 97.7 KB gzipped browser bundle we measured is another reason to run it during builds rather than in application code.

58.2Mdownloads / wk
Verdict

Autoprefixer 10.5.4 installed in 1.2 seconds with 17 packages, used 7 MB, and returned 0 audit findings in our sandbox; it is an easy build dependency when Browserslist still selects prefixed CSS. Do not add it beside another prefixing compiler or expect its opt-in IE Grid conversion to behave like a layout polyfill.

We installed it

Lab card: what happened when we installed autoprefixerScreenshot of autoprefixer documentation
Install✓ · 1.2s17 packages on disk · 7 MB
ImportESM import works · require() works · CommonJS package
Browser97.7 KBgzipped (323.4 KB minified), bundled with esbuild
TypesTypeScript types bundled
Known vulns00 critical · 0 high · 0 moderate · 0 low (npm audit)

Answers from our run

Does autoprefixer install cleanly?

Yes. In a fresh container with an empty cache, npm install autoprefixer finished in 1 seconds, leaving 17 packages and 7 MB on disk. npm audit reported no known vulnerabilities.

How much does autoprefixer add to a browser bundle?

97.7 KB gzipped (323.4 KB minified) when the whole package is bundled for the browser with esbuild. Importing only part of it is usually smaller.

Does autoprefixer work with both ESM and CommonJS?

Yes. Both import 'autoprefixer' and require('autoprefixer') worked in Node 22 in our run. The package is published as CommonJS.

Does autoprefixer include TypeScript types?

Yes, type declarations ship inside the package, so no @types install is needed.

autoprefixer or lightningcss: which should you use?

Pick lightningcss when one compiler should lower newer CSS, add prefixes, and minify the result. Autoprefixer 10.5.4 installed in 1.2 seconds with 17 packages, used 7 MB, and returned 0 audit findings in our sandbox; it is an easy build dependency when Browserslist still selects prefixed CSS.

When should you not use autoprefixer?

Lightning CSS already prefixes the same output; running two prefixing passes adds another data source and makes generated CSS harder to attribute.

API stability5/5Autoprefixer 10 still uses the PostCSS 8 plugin contract: call the exported function with an options object and include the returned plugin in a processor. The add, remove, cascade, supports, flexbox, and grid controls remain documented. Releases in the 10.5 line changed individual prefix cases, including mask-position support and duplicate-rule handling, without replacing project configuration.
Docs4/5The README explains Browserslist lookup, JavaScript use, CLI boundaries, warnings, control comments, every public option, and environment variables. Its IE Grid section names unsupported autoplacement cases and tells readers to test in IE. Some integration examples still center on older task runners, so current Vite, webpack, or framework wiring has to be checked in that tool's PostCSS documentation.
Maintenance4/5GitHub showed a push on July 23, 2026, 39 open issues and pull requests, 22,236 stars, and an unarchived repository. npm listed 10.5.4 as current, and its changelog records a focused duplicated-rule fix after parser and gradient corrections. This is mature compatibility software with regular small corrections rather than a fast-changing public API.
Ecosystem5/5The npm downloads service recorded 65,856,242 downloads for August 18 through 24, 2026. Autoprefixer reads the Browserslist format also used by Babel and related front-end tools, and broader packages such as postcss-preset-env include it. PostCSS adapters in common build systems can load it directly, while our checks found both require and import usable from Node.

Discussed on

  1. hnAutoprefixer 6.1 is out with CSS-in-JS and :read-only support44 points
  2. hnPostCSS – beyond the Autoprefixer9 points
  3. hnAutoprefixer 6.0 is out with PostCSS 5.0 and many new prefixes9 points

Use it if

  • Your PostCSS pipeline should derive vendor prefixes from one shared Browserslist policy instead of handwritten compatibility rules.
  • Supported Safari, Firefox, or Samsung Internet versions still need prefixes for CSS used by the project.
  • The stylesheet contains stale vendor declarations that should disappear as the browser target list moves forward.
  • Babel, Stylelint, and CSS processing need to read the same browser targets from package.json or .browserslistrc.
Skip it if

Setup reality

We installed Autoprefixer 10.5.4 in a clean Node 22 container in 1.2 seconds. The install left 17 packages and 7 MB on disk; npm audit found 0 known vulnerabilities. Autoprefixer declares 5 direct dependencies plus 1 peer dependency, PostCSS, and the package itself is 452 KB unpacked. It includes TypeScript declarations. CommonJS require and ESM import both worked even though the package is CommonJS and has no exports map.

Add PostCSS explicitly, then place Autoprefixer after plugins that emit new declarations and before CSS minification. It needs no account or credential. Browser policy is the configuration that matters: put it in a Browserslist file or package.json so every compatible tool reads the same query. A plugin-level override is available for a deliberately separate legacy build.

Prefix decisions depend on caniuse-lite recorded in the lockfile. Refresh that data with update-browserslist-db when the tooling reports it as stale, and review the resulting lockfile diff. npx autoprefixer --info prints the browsers and prefixes selected by the installed data and current query.

Our esbuild check turned a full package import into 323.4 KB minified and 97.7 KB gzipped. Keep the plugin on the build side. IE Grid output also needs a deliberate grid option, environment variable, or CSS control comment; the README requires testing because its autoplacement conversion has documented gaps.

Patterns

Add it to PostCSS configure-postcss

// postcss.config.cjs
module.exports = {
  plugins: [require('autoprefixer')()]
};

Autoprefixer 10 uses the PostCSS 8 plugin API. Run it after plugins that create declarations and before minification.

Declare shared browser targets set-browser-targets

// package.json
{
  "browserslist": [
    "defaults",
    "not IE 11"
  ]
}

Autoprefixer reads Browserslist. A package-level query is also visible to Babel and other consumers.

Print the selected support table inspect-prefixes

npx autoprefixer --info

The report uses the installed caniuse-lite data and active Browserslist environment, so it shows what this build will emit.

Update caniuse-lite in the lockfile refresh-browser-data

npx update-browserslist-db@latest

The browser database is pinned through the lockfile. Inspect and commit that dependency change like any other update.

Transform a CSS string process-css

const postcss = require('postcss');
const autoprefixer = require('autoprefixer');

const result = await postcss([autoprefixer()]).process(css, {
  from: 'src/site.css',
  to: 'dist/site.css'
});
console.log(result.css);

Supplying from and to paths gives PostCSS useful source locations and source-map context.

Surface parser warnings report-warnings

const result = await postcss([autoprefixer()]).process(css, { from: undefined });
for (const warning of result.warnings()) {
  console.warn(warning.toString());
}

A custom script must consume result.warnings(); otherwise notices about syntax the plugin cannot safely rewrite stay hidden.

Keep existing vendor declarations preserve-old-prefixes

autoprefixer({ remove: false })

remove defaults to true. Disable it only when handwritten prefixes serve devices outside the declared browser targets.

Remove obsolete prefixes without adding new ones cleanup-only

autoprefixer({ add: false })

This mode still uses the Browserslist query to decide which existing declarations are obsolete.

Generate partial IE Grid CSS enable-ie-grid

autoprefixer({ grid: 'autoplace' })

Autoplacement support is partial. The README excludes auto-fit, auto-fill, several span cases, and generated pseudo-elements from safe conversion.

Opt in one CSS block enable-grid-for-block

/* autoprefixer grid: autoplace */
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

The control comment limits the risky IE Grid conversion to CSS that you can test in the target browser.

Leave one declaration untouched ignore-next-declaration

.icon {
  /* autoprefixer: ignore next */
  appearance: none;
  user-select: none;
}

`ignore next` affects one declaration. `autoprefixer: off` applies to the whole block regardless of where the comment appears.

Override browsers for a separate artifact build-legacy-target

autoprefixer({
  overrideBrowserslist: ['ie 11', 'last 2 Safari versions']
})

A local override no longer matches shared Browserslist consumers, so reserve it for an intentionally separate build output.

Alternatives

PackageRegistryPick it when
lightningcssnpmPick it when one compiler should lower newer CSS, add prefixes, and minify the result.
postcss-preset-envnpmPick it when a PostCSS preset should transform selected future CSS features as well as run Autoprefixer.
stylisnpmPick it for prefixing inside a CSS-in-JS runtime built around Stylis middleware.

More web frontend guides

postcss · react · react-dom · tailwindcss · htmlparser2 · tailwind-merge · the whole shelf →

How this guide is made: grounded in the library's documentation, release notes, changelog, and issue history, on a fixed rubric — not a hands-on install of every release. The 50 most-downloaded entries are additionally install-verified in clean containers. Corrections: contact the desk.