Detalhes do pacote

postcss-short-border-radius

jonathantneal34.2kCC0-1.03.0.0

Use more border-radius properties in CSS

postcss, css, postcss-plugin, border

readme (leia-me)

PostCSS Short Border Radius PostCSS

NPM Version Build Status Support Chat

PostCSS Short Border Radius lets you use border-top-radius, border-right-radius, border-bottom-radius, and border-left-radius properties in CSS, following the 1-to-2 syntax.

.example-1 {
  border-top-radius: 10px;
}

.example-2 {
  border-top-radius: 10px 5px;
}

/* becomes */

.example-1 {
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.example-2 {
  border-top-left-radius: 10px;
  border-top-right-radius: 5px;
}

Usage

Add PostCSS Short Border Radius to your project:

npm install postcss-short-border-radius --save-dev

Use PostCSS Short Border Radius to process your CSS:

const postcssShortBorderRadius = require('postcss-short-border-radius');

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

Or use it as a PostCSS plugin:

const postcss = require('postcss');
const postcssShortBorderRadius = require('postcss-short-border-radius');

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

PostCSS Short Border Radius 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-border-top-radius.

postcssShortBorderRadius({ prefix: 'x' });
.example-1 {
  -x-border-top-radius: 10px;
}

/* becomes */

.example-1 {
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

skip

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

postcssShortBorderRadius({ skip: '-' });
.example-1 {
  -x-border-top-radius: - 10px;
}

/* becomes */

.example-1 {
  border-top-right-radius: 10px;
}

changelog (log de mudanças)

Changes to PostCSS Short Border Radius

3.0.0 (October 10, 2018)

  • Added: Support for PostCSS 7, Node 6

2.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.0 beta 2 (December 8, 2016)

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

2.0.0 beta 1 (December 6, 2016)

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

1.0.0 (October 3, 2016)

  • Added: Initial version