@csstools/postcss-initial
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.0.1503,420latest

Version History

VersionDownloads (Last 7 Days)Published
2.0.1503,420
2.0.0312,149
1.0.1425,976
1.0.059,219

Package Sidebar

Install

npm i @csstools/postcss-initial

Weekly Downloads

1,300,764

Version

2.0.1

License

MIT-0

Unpacked Size

16.3 kB

Total Files

7

Last publish

Collaborators

  • jonathantneal
  • alaguna
  • romainmenke