JSPM

postcss-short-position

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

Define sides within the position property in CSS

Package Exports

  • postcss-short-position

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

Readme

Position Shorthand PostCSS Logo

NPM Version Build Status Licensing Changelog Gitter Chat

Position Shorthand lets you define sides within the position property in CSS, following the 1-to-4 syntax to target top, right, bottom, and left.

/* before */

.example-1 {
    position: fixed 0 1em;
}

/* after */

.example-1 {
    top: 0;
    right: 1em;
    bottom: 0;
    left: 1em;
    position: fixed;
}

Options

prefix

Type: String
Default: ""

Adds an optional prefix to the position property (e.g. "x" for -x-position). Wrapping dashes (-) are automatically applied.

skip

Type: String
Default: "*"

Specifies the skip token used to ignore a length.

Usage

Add Position Shorthand to your build tool:

npm install postcss-short-position --save-dev

Node

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

PostCSS

Add PostCSS to your build tool:

npm install postcss --save-dev

Load Position Shorthand as a PostCSS plugin:

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

Gulp

Add Gulp PostCSS to your build tool:

npm install gulp-postcss --save-dev

Enable Position Shorthand within your Gulpfile:

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

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

Grunt

Add Grunt PostCSS to your build tool:

npm install grunt-postcss --save-dev

Enable Position Shorthand within your Gruntfile:

grunt.loadNpmTasks('grunt-postcss');

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