Skip to content

Files

Latest commit

bc0825d · Feb 23, 2025

History

History

postcss-initial

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Feb 12, 2025
Nov 11, 2024
Aug 3, 2024
Feb 12, 2025
Feb 12, 2025
Sep 18, 2023
Nov 11, 2024
Feb 12, 2025
Sep 18, 2023
Sep 18, 2023
Feb 23, 2025
Dec 15, 2023
Feb 12, 2025
Sep 18, 2023

PostCSS Initial PostCSS Logo

npm version Build Status Discord

Baseline Status CSS Standard Status

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 */);

PostCSS Initial runs in all Node environments, with special instructions for:

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;
}