JSPM

postcss-short-spacing

2.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4723
  • Score
    100M100P100Q138069F
  • License CC0-1.0

Omit edges within margin and padding properties in CSS

Package Exports

  • postcss-short-spacing

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-short-spacing) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Spacing Shorthand PostCSS Logo

NPM Version Build Status Licensing Changelog Gitter Chat

Spacing Shorthand lets you omit sides within margin and padding properties in CSS.

/* before */

section {
    margin: 1em *;
}

/* after */

section {
    margin-top: 1em;
    margin-bottom: 1em;
}

Options

prefix

Type: String
Default: ""

Adds an optional prefix to the margin and padding properties (e.g. "x" for -x-margin). Wrapping dashes (-) are automatically applied.

skip

Type: String
Default: "*"

Specifies the skip token used to ignore a length.

Usage

Add Spacing Shorthand to your build tool:

npm install postcss-short-spacing --save-dev

Node

require('postcss-short-spacing').process(YOUR_CSS, { /* options */ });

PostCSS

Add PostCSS to your build tool:

npm install postcss --save-dev

Load Spacing Shorthand as a PostCSS plugin:

postcss([
    require('postcss-short-spacing')({ /* options */ })
]).process(YOUR_CSS, /* options */);

Gulp

Add Gulp PostCSS to your build tool:

npm install gulp-postcss --save-dev

Enable Spacing Shorthand within your Gulpfile:

var postcss = require('gulp-postcss');

gulp.task('css', function () {
    return gulp.src('./src/*.css').pipe(
        postcss([
            require('postcss-short-spacing')({ /* options */ })
        ])
    ).pipe(
        gulp.dest('.')
    );
});

Grunt

Add Grunt PostCSS to your build tool:

npm install grunt-postcss --save-dev

Enable Spacing Shorthand within your Gruntfile:

grunt.loadNpmTasks('grunt-postcss');

grunt.initConfig({
    postcss: {
        options: {
            use: [
                require('postcss-short-spacing')({ /* options */ })
            ]
        },
        dist: {
            src: '*.css'
        }
    }
});