JSPM

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

short

Package Exports

  • postcss-short

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

Readme

Short Build Status

Short is a PostCSS plugin that lets you use shorthand properties in CSS.

Shorthand properties allow you write more concise and often more readable style sheets, saving time and energy.

/* before */

.banner {
    position: fixed 0 0 *;
    size: 100% 48px;
}

.section {
    margin: 40px;
    text: bold center uppercase dimgrey 1.25em 1.5 .05em;
}

.section.inset {
    margin: * auto;
}

/* after */

.banner {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 48px;
}

.section {
    margin: 40px;
    color: dimgrey;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    font-size: 1.25em;
    line-height: 1.5;
    letter-spacing: .05em;
}

.section.inset {
    margin-right: auto;
    margin-left: auto;
}

Usage

Follow these steps to use Short.

Add Short to your build tool:

npm install postcss-short --save-dev

Node

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

PostCSS

Add PostCSS to your build tool:

npm install postcss --save-dev

Load Short as a PostCSS plugin:

postcss([
    require('postcss-short')({ /* options */ })
]);

Gulp

Add Gulp PostCSS to your build tool:

npm install gulp-postcss --save-dev

Enable Short within your Gulpfile:

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

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

Grunt

Add Grunt PostCSS to your build tool:

npm install grunt-postcss --save-dev

Enable Short within your Gruntfile:

grunt.loadNpmTasks('grunt-postcss');

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

Plugins

Short is powered by the following plugins (in order):

Options

Each plugin’s options may be configured by targeting the plugin’s namespace. Any plugins may be disabled by giving them a disable property.

Example:

require('postcss-short')({
    'font-size': {
        prefix: 'x'
    },
    'position': {
        disable: true
    }
})