🎨
UI Component30M+/wkMIT

autoprefixer

Autoprefixer is a PostCSS plugin that automatically adds vendor prefixes to CSS rules based on current browser usage data from Can I Use. Vendor prefixes (-webk

Installation

npm
npm install -D autoprefixer
yarn
yarn add -D autoprefixer
pnpm
pnpm add -D autoprefixer

Import

ESM
// Used as PostCSS plugin

Quick Example

usage
// postcss.config.js
module.exports = {
  plugins: {
    autoprefixer: {},
  },
};

// .browserslistrc
// > 1%
// last 2 versions
// not dead

About autoprefixer

Autoprefixer is a PostCSS plugin that automatically adds vendor prefixes to CSS rules based on current browser usage data from Can I Use. Vendor prefixes (-webkit-, -moz-, -ms-, -o-) were historically needed for browsers to support experimental CSS properties, and manually managing them was tedious and error-prone. Autoprefixer lets you write clean, unprefixed CSS and handles the prefixing automatically based on your target browser configuration. The plugin reads your browserslist configuration (from .browserslistrc, package.json, or inline) to determine which browsers to support, then adds only the necessary prefixes — if all your target browsers support a property natively, no prefix is added. Autoprefixer handles complex properties like flexbox (where different browsers used different syntaxes), gradients, transforms, transitions, animations, and grid layout. The plugin also removes outdated prefixes that are no longer needed, keeping your CSS clean. Autoprefixer is considered essential in modern CSS workflows and is included by default in most build tool configurations. It works seamlessly with Tailwind CSS, Sass, and other CSS tools through the PostCSS pipeline. The plugin is maintained by Andrey Sitnik, who also created PostCSS.

Quick Facts

Packageautoprefixer
CategoryUI Component
Weekly Downloads30M+
LicenseMIT
Installnpm install -D autoprefixer

Related Packages

Browse npm Packages by Category

Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.