postcss-position

PostCSS plugin that adds shorthand attributes methods to position declarations.

MIT 11 个版本
安装
npm install postcss-position
yarn add postcss-position
pnpm add postcss-position
bun add postcss-position
README

PostCSS Position

NPM version Downloads Build Status

PostCSS plugin that adds shorthand attributes to position declarations.

Part of Rucksack - CSS Superpowers

Input

.foo {
  position: absolute 10px 0;
}

.bar {
  position: fixed 0;
}

.baz {
  position: relative 30% auto 0;
}

.fab {
  position: absolute 10px 0 20px 30px;
}

Output

.foo {
  position: absolute;
  top: 10px;
  right: 0;
  bottom: 10px;
  left: 0;
}

.bar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.baz {
  position: relative;
  top: 30%;
  right: auto;
  bottom: 0;
  left: auto;
}

.fab {
  position: absolute;
  top: 10px;
  right: 0;
  bottom: 20px;
  left: 30px;
}

Usage

postcss([ require('postcss-position') ])

See PostCSS docs for examples for your environment.


MIT © Sean King

版本列表
1.1.0 2019-11-04
1.0.0 2017-07-26
0.5.0 2016-06-02
0.4.0 2015-09-06
0.3.1 2015-08-15
0.3.0 2015-08-15
0.2.1 2015-07-21
0.2.0 2015-06-16
0.1.1 2015-06-16
0.1.0 2015-06-15
0.0.0 2015-06-15