postcss-comment-annotation

1.1.0 • Public • Published

PostCSS Comment Annotation Build Status

PostCSS plugin for annotating comments, inspired by and based on morishitter's CSS 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.

/*
@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.

[
  {
    "define": "Foo",
    "description": "Foo is a base component"
  }, {
    "define": "Bar",
    "parent": "Foo",
    "modifier": true,
    "description": "Bar modifies Foo"
  }
]

Usage

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

Options

prefix

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

Package Sidebar

Install

npm i postcss-comment-annotation

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

5.36 kB

Total Files

5

Last publish

Collaborators

  • matthewferry