# postcss-shape

> draw some basic shape with css

Latest version **0.0.1** (published 2016-04-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-shape
pnpm add postcss-shape
yarn add postcss-shape
bun add postcss-shape
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2016-04-22 |
| First published | 2016-04-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.12.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 14 |
| Author | https://github.com/baiyaaaaa |
| Maintainers | baiyaaaaa |
| Keywords | postcss, css, postcss-plugin, shape |

## Links

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

## Dependencies (1)

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

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

- 0.0.1 (latest) — 2016-04-22

## README

# PostCSS Shape [![Build Status][travis-img]][travis]

[PostCSS] plugin to draw basic shape with specified syntax in css rule.

## Syntax

###rect
`rect: [width] [height] [background-color]`

```css
/* before */
.rect-a {
  rect: 30px 50px #ff0;
}
.rect-b {
  rect: 30px * #ff0;
}

/* after */
.rect-a {
  width: 30px;
  height: 50px;
  background-color: #ff0;
}
.rect-b {
  width: 30px;
  background-color: #ff0;
}
```

###circle
`circle: [diameter] [background-color]`

```css
/* before */
.circle-a {
  circle: 50px #ff0;
}
.circle-b {
  circle: 50px *;
}

/* after */
.circle-a {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #ff0;
}
.circle-b {
  width: 50px;
  height: 50px;
  border-radius: 50%;
}
```

###triangle
`triangle: [size] [direction] [color]`

```css
/* before */
.triangle-a {
  triangle: 5px top #ff0;
}

/* after */
.triangle-a {
  display: inline-block;
  width: 0;
  height: 0;
  border: solid transparent;
  border-width: 5px;
  border-bottom-color: #ff0;
}
```

*can not ignore any value in triangle*

## Usage

Add [Postcss Shape] to your build tool:

```bash
npm install postcss-shape --save-dev
```

#### Node

```js
require('postcss-shape').process(YOUR_CSS, { /* options */ });
```

#### PostCSS

Add [PostCSS] to your build tool:

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

Load [Postcss Shape] as a PostCSS plugin:

```js
postcss([
  require('postcss-shape')({ /* options */ })
]).process(YOUR_CSS, /* options */);
```

#### Gulp

Add [Gulp PostCSS] to your build tool:

```bash
npm install gulp-postcss --save-dev
```

Enable [Postcss Shape] within your Gulpfile:

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

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

#### Grunt

Add [Grunt PostCSS] to your build tool:

```bash
npm install grunt-postcss --save-dev
```

Enable [Postcss Shape] within your Gruntfile:

```js
grunt.loadNpmTasks('grunt-postcss');

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

[PostCSS]: https://github.com/postcss/postcss
[Postcss Shape]: https://github.com/baiyaaaaa/postcss-shape
[travis-img]:  https://travis-ci.org/baiyaaaaa/postcss-shape.svg
[travis]:      https://travis-ci.org/baiyaaaaa/postcss-shape
[Gulp PostCSS]: https://github.com/postcss/gulp-postcss
[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss

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