npm.io
1.0.1 • Published 2 weeks ago

@csstools/postcss-fit-tolerance-property

Licence
MIT-0
Version
1.0.1
Deps
0
Size
5 kB
Vulns
0
Weekly
0
Stars
1.1K

PostCSS Fit Tolerance Property PostCSS Logo

npm install @csstools/postcss-fit-tolerance-property --save-dev

PostCSS Fit Tolerance Property lets you use the fit-tolerance property following the CSS Grid Specification.
This initially shipped in some browser versions as flow-tolerance.

.foo {
	fit-tolerance: 2em;
}

/* becomes */

.foo {
	flow-tolerance: 2em;
	fit-tolerance: 2em;
}

Usage

Add PostCSS Fit Tolerance Property to your project:

npm install postcss @csstools/postcss-fit-tolerance-property --save-dev

Use it as a PostCSS plugin:

const postcss = require('postcss');
const postcssFitToleranceProperty = require('@csstools/postcss-fit-tolerance-property');

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

Options

preserve

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

postcssFitToleranceProperty({ preserve: false })
.foo {
	fit-tolerance: 2em;
}

/* becomes */

.foo {
	flow-tolerance: 2em;
}

Keywords