postcss-overflow-shorthand

Use the overflow shorthand in CSS

MIT-0 14 个版本
安装
npm install postcss-overflow-shorthand
yarn add postcss-overflow-shorthand
pnpm add postcss-overflow-shorthand
bun add postcss-overflow-shorthand
README

PostCSS Overflow Shorthand PostCSS Logo

npm install postcss-overflow-shorthand --save-dev

PostCSS Overflow Shorthand lets you use the overflow shorthand in CSS, following the CSS Overflow specification.

html {
	overflow: hidden auto;
}

/* becomes */

html {
	overflow-x: hidden;
	overflow-y: auto;
	overflow: hidden auto;
}

Usage

Add PostCSS Overflow Shorthand to your project:

npm install postcss postcss-overflow-shorthand --save-dev

Use it as a PostCSS plugin:

const postcss = require('postcss');
const postcssOverflowShorthand = require('postcss-overflow-shorthand');

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

Options

preserve

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

postcssOverflowShorthand({ preserve: false })
html {
	overflow: hidden auto;
}

/* becomes */

html {
	overflow-x: hidden;
	overflow-y: auto;
}
版本列表
7.0.0 2026-01-14
6.0.0 2024-08-03
5.0.1 2023-12-15
5.0.0 2023-07-03
4.0.1 2023-01-28
4.0.0 2023-01-24
3.0.4 2022-07-08
3.0.3 2022-02-05
3.0.2 2022-01-02
3.0.1 2021-12-13
3.0.0 2021-09-17
2.0.0 2018-09-18
1.0.1 2018-05-08
1.0.0 2018-05-01