Detalhes do pacote

postcss-short-position

jonathantneal25.2kCC0-1.0depreciado4.0.1

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

Define sides within the position property in CSS

postcss, css, postcss-plugin, position

readme (leia-me)

PostCSS Short Position PostCSS

NPM Version Build Status Support Chat

PostCSS Short Position lets define sides within the position property in CSS.

.header {
  position: fixed 0 1em *;
}

/* becomes */

.header {
  top: 0;
  right: 1em;
  left: 1em;
  position: fixed;
}

The position declaration can be extended with the 1-to-4 syntax to target top, right, bottom, and left. Sides can be omitted using the skip token.

Usage

Add PostCSS Short Position to your project:

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

Use PostCSS Short Position to process your CSS:

const postcssShortPosition = require('postcss-short-position');

postcssShortPosition.process(YOUR_CSS /*, processOptions, pluginOptions */);

Or use it as a PostCSS plugin:

const postcss = require('postcss');
const postcssShortPosition = require('postcss-short-position');

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

PostCSS Short Position runs in all Node environments, with special instructions for:

Node PostCSS CLI Webpack Create React App Gulp Grunt

Options

prefix

The prefix option defines a prefix required by properties being transformed. Wrapping dashes are automatically applied, so that x would transform -x-position.

postcssShortPosition({ prefix: 'x' });
.header {
  x-position: fixed 0 1em *;
}

/* becomes */

.header {
  top: 0;
  right: 1em;
  left: 1em;
  position: fixed;
}

skip

The skip option defines the skip token used to ignore portions of the shorthand.

postcssShortPosition({ skip: '-' });
.header {
  position: fixed 0 1em -;
}

/* becomes */

.header {
  top: 0;
  right: 1em;
  left: 1em;
  position: fixed;
}

changelog (log de mudanças)

Changes to PostCSS Short Position

4.0.1 (October 10, 2018)

  • Updated documentation

4.0.0 (October 9, 2018)

  • Added: Support for PostCSS 7, Node 6

3.0.0 (May 25, 2017)

  • Added: Support for PostCSS 6, Node 4
  • Removed: echint and jscs devDependencies
  • Updated: 2 spaces in Markdown
  • Updated: dependencies

2.0.1 (December 8, 2016)

  • Updated: Use destructing assignment on plugin options
  • Updated: Use template literals

2.0.0 (September 27, 2016)

  • Added: Define skip token
  • Updated: boilerplate conventions (Node v6.9.1 LTS)

1.0.0 (September 19, 2015)

  • Added: Initial release