usercss-parser
v0.0.1
Published
A new, modern parser for UserCSS documents. Takes inspiration from Stylus' [usercss-meta](https://github.com/openstyles/usercss-meta) library, but with more capability and forgiving behavior.
Readme
usercss-parser
A new, modern parser for UserCSS documents. Takes inspiration from Stylus' usercss-meta library, but with more capability and forgiving behavior.
Usage
import { parse } from 'usercss-parser';
const { metadata, sections, issues } = parse(`
/* ==UserStyle==
@name My Userstyle
@namespace github.com/me
@version 0.1.0
@author Me <[email protected]>
@license MIT
==/UserStyle== */
@-moz-document domain("example.org") {
a:link,
a:visited {
color: red;
}
}`);
// {
// metadata: {
// vars: [],
// name: 'My Userstyle',
// namespace: 'github.com/me',
// version: '0.1.0',
// author: { name: 'Me', email: '[email protected]' },
// license: 'MIT'
// },
// sections: [
// {
// matches: [ { name: 'domain', value: 'example.org' } ],
// body: 'a:link,\n a:visited {\n color: red;\n }'
// }
// ],
// issues: []
// }