# postcss-short-position

> Define sides within the position property in CSS

Latest version **4.0.1** (published 2018-10-10) · CC0-1.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install postcss-short-position
pnpm add postcss-short-position
yarn add postcss-short-position
bun add postcss-short-position
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 4.0.1 |
| Published | 2018-10-10 |
| First published | 2015-09-21 |
| Weekly downloads | 0 |
| License | CC0-1.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=6.0.0 |
| Dependencies | 1 |
| Unpacked size | 27.1 KB |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Jonathan Neal |
| Maintainers | jonathantneal |
| Keywords | postcss, css, postcss-plugin, position, top, right, bottom, left, inset, shorthand, short |

## Links

- npm: https://www.npmjs.com/package/postcss-short-position
- Repository: https://github.com/jonathantneal/postcss-short-position
- Homepage: https://github.com/jonathantneal/postcss-short-position#readme
- Issues: https://github.com/jonathantneal/postcss-short-position/issues
- npm.io page: https://npm.io/package/postcss-short-position

## Dependencies (1)

- [postcss](https://npm.io/package/postcss.md) ^7.0.5

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 4.0.1 (latest) — 2018-10-10
- 4.0.0 — 2018-10-10
- 3.0.0 — 2017-05-25
- 2.0.1 — 2016-12-14
- 2.0.0 — 2016-12-06
- 1.0.0 — 2015-09-21

## README

# PostCSS Short Position [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS" width="90" height="90" align="right">][postcss]

[![NPM Version][npm-img]][npm-url]
[![Build Status][cli-img]][cli-url]
[![Support Chat][git-img]][git-url]

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

```pcss
.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:

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

Use [PostCSS Short Position] to process your CSS:

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

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

Or use it as a [PostCSS] plugin:

```js
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](INSTALL.md#node) | [PostCSS CLI](INSTALL.md#postcss-cli) | [Webpack](INSTALL.md#webpack) | [Create React App](INSTALL.md#create-react-app) | [Gulp](INSTALL.md#gulp) | [Grunt](INSTALL.md#grunt) |
| --- | --- | --- | --- | --- | --- |

[cli-img]: https://img.shields.io/travis/jonathantneal/postcss-short-position.svg
[cli-url]: https://travis-ci.org/jonathantneal/postcss-short-position
[git-img]: https://img.shields.io/badge/support-chat-blue.svg
[git-url]: https://gitter.im/postcss/postcss
[npm-img]: https://img.shields.io/npm/v/postcss-short-position.svg
[npm-url]: https://www.npmjs.com/package/postcss-short-position

## 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`.

```js
postcssShortPosition({ prefix: 'x' });
```

```pcss
.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.

```js
postcssShortPosition({ skip: '-' });
```

```pcss
.header {
  position: fixed 0 1em -;
}

/* becomes */

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

[1-to-4 syntax]: https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties#Tricky_edge_cases
[PostCSS]: https://github.com/postcss/postcss
[PostCSS Short Position]: https://github.com/jonathantneal/postcss-short-position

---
_Source: https://npm.io/package/postcss-short-position · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
