# postcss-comment-annotation

> PostCSS plugin for annotating comments

Latest version **1.1.0** (published 2018-07-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-comment-annotation
pnpm add postcss-comment-annotation
yarn add postcss-comment-annotation
bun add postcss-comment-annotation
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2018-07-10 |
| First published | 2017-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Matthew Ferry |
| Maintainers | matthewferry |
| Keywords | postcss, css, postcss-plugin, comments, annotation |

## Links

- npm: https://www.npmjs.com/package/postcss-comment-annotation
- Repository: https://github.com/matthewferry/postcss-comment-annotation
- Issues: https://github.com/matthewferry/postcss-comment-annotation/issues
- npm.io page: https://npm.io/package/postcss-comment-annotation

## Dependencies (1)

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

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

- 1.1.0 (latest) — 2018-07-10
- 1.0.0 — 2017-05-17

## README

# PostCSS Comment Annotation [![Build Status][ci-img]][ci]

[PostCSS] plugin for annotating comments, inspired by and based on
[morishitter](https://github.com/morishitter)'s [CSS Annotation](https://github.com/morishitter/css-annotation).

[PostCSS]: https://github.com/postcss/postcss
[ci-img]:  https://travis-ci.org/matthewferry/postcss-comment-annotation.svg
[ci]:      https://travis-ci.org/matthewferry/postcss-comment-annotation

## Install
`npm install postcss-comment-annotation`

## Example
Annotate your CSS with key/value pairs. Keys without a defined value
results in a value of `true`.
```css
/*
@define Foo

@description
Foo is a base component
*/
.foo { }

/*
@define Bar
@parent Foo
@modifier

@description
Bar modifies Foo
*/
.foo-bar { }
```

Outputs an array to `result.commentAnnotations`.
```js
[
  {
    "define": "Foo",
    "description": "Foo is a base component"
  }, {
    "define": "Bar",
    "parent": "Foo",
    "modifier": true,
    "description": "Bar modifies Foo"
  }
]
```

## Usage

```js
postcss([
  require('postcss-comment-annotation')({
    prefix: '@'
  })
])
```

## Options

### prefix

Takes `string`.
Define the prefix to signify keys in your annotations.
Default value: `@`.

## [Changelog](./CHANGELOG.md)

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