Annotation parser for CSS
$ npm install css-annotation
input.css
:
/*
* @foo foofoo
* @bar bar bar bar
*/
@media screen (min-width: 600px) {
/*
* @hoge
*/
.class {
/*
* @baz baz1, baz2, baz3
*/
font-size: 12px;
}
}
var fs = require('fs')
var annotation = require('./')
var css = fs.readFileSync('input.css', 'utf-8').trim()
annotation.parse(css)
/*
[
{
foo: 'foofoo',
bar: 'bar bar bar'
},
{
atrule: 'media',
hoge: true,
params: 'screen (min-width: 600px)'
},
{
baz: ['baz1', 'baz2', 'baz3']
rule: '.class'
}
]
*/
Parse annotation comment in css
and return array of its results.
commentText
is PostCSS's comment.text
.
Return its parse results.
The MIT License (MIT)
Copyright (c) 2014 Masaaki Morishita