Package Exports
- postcss-overflow-shorthand
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (postcss-overflow-shorthand) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
PostCSS Overflow Shorthand 
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 build tool:
npm install postcss-overflow-shorthand --save-dev
Node
Use PostCSS Overflow Shorthand to process your CSS:
import postcssOverflowShorthand from 'postcss-overflow-shorthand';
postcssOverflowShorthand.process(YOUR_CSS, /* processOptions */, /* pluginOptions */);
PostCSS
Add PostCSS to your build tool:
npm install postcss --save-dev
Use PostCSS Overflow Shorthand as a plugin:
import postcss from 'gulp-postcss';
import postcssOverflowShorthand from 'postcss-overflow-shorthand';
postcss([
postcssOverflowShorthand(/* pluginOptions */)
]).process(YOUR_CSS);
Webpack
Add PostCSS Loader to your build tool:
npm install postcss-loader --save-dev
Use PostCSS Overflow Shorthand in your Webpack configuration:
import postcssOverflowShorthand from 'postcss-overflow-shorthand';
module.exports = {
module: {
rules: [
{
test: /\.css$/,
use: [
'style-loader',
{ loader: 'css-loader', options: { importLoaders: 1 } },
{ loader: 'postcss-loader', options: {
ident: 'postcss',
plugins: () => [
postcssOverflowShorthand(/* pluginOptions */)
]
} }
]
}
]
}
}
Gulp
Add Gulp PostCSS to your build tool:
npm install gulp-postcss --save-dev
Use PostCSS Overflow Shorthand in your Gulpfile:
import postcss from 'gulp-postcss';
import postcssOverflowShorthand from 'postcss-overflow-shorthand';
gulp.task('css', () => gulp.src('./src/*.css').pipe(
postcss([
postcssOverflowShorthand(/* pluginOptions */)
])
).pipe(
gulp.dest('.')
));
Grunt
Add Grunt PostCSS to your build tool:
npm install grunt-postcss --save-dev
Use PostCSS Overflow Shorthand in your Gruntfile:
import postcssOverflowShorthand from 'postcss-overflow-shorthand';
grunt.loadNpmTasks('grunt-postcss');
grunt.initConfig({
postcss: {
options: {
use: [
postcssOverflowShorthand(/* pluginOptions */)
]
},
dist: {
src: '*.css'
}
}
});
Options
preserve
The preserve
option determines whether the original overflow
declaration is
preserved. By default, it is preserved.
postcssOverflowShorthand({ preserve: false })
html {
overflow: hidden auto;
}
/* becomes */
html {
overflow-x: hidden;
overflow-y: auto;
}