Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@csstools/postcss-initial

csstools5.4mMIT-03.0.0TypeScript support: included

PostCSS plugin to fallback initial keyword.

postcss-plugin

readme

PostCSS Initial PostCSS Logo

npm install @csstools/postcss-initial --save-dev

PostCSS Initial fallback the initial keyword following the CSS Cascade 4 Specification.

.foo {
    border: initial;
}

/* becomes */

.foo {
    border: medium none currentcolor;
    border: initial;
}

See prior work by maximkoretskiy here postcss-initial To ensure long term maintenance and to provide the needed features this plugin was recreated based on maximkoretskiy's work.

Usage

Add PostCSS Initial to your project:

npm install postcss @csstools/postcss-initial --save-dev

Use it as a PostCSS plugin:

const postcss = require('postcss');
const postcssInitial = require('@csstools/postcss-initial');

postcss([
    postcssInitial(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);

Options

preserve

The preserve option determines whether the original notation is preserved. By default, it is preserved.

postcssInitial({ preserve: false })
.foo {
    border: initial;
}

/* becomes */

.foo {
    border: medium none currentcolor;
}

changelog

Changes to PostCSS Initial

3.0.0

January 14, 2026

  • Updated: Support for Node 20.19.0 or later (major).
  • Removed: commonjs API. In supported Node versions require(esm) will work without needing to make code changes.

Full CHANGELOG