NV / CSSOM

Unmaintained! ⚠️ CSS Object Model implemented in pure JavaScript. Also, a CSS parser.
https://nv.github.io/CSSOM/docs/parse.html
MIT License
751 stars 99 forks source link

Expose `parse` to `CSSGroupingRule` #114

Open MrDOS opened 2 years ago

MrDOS commented 2 years ago

CSSGroupingRule.insertRule requires parse. Previously:

$ pwd
/path/to/CSSOM
$ node
Welcome to Node.js v18.1.0.
Type ".help" for more information.
> const CSSOM = require('./lib');
undefined
> const rule = new CSSOM.CSSGroupingRule();
undefined
> rule.insertRule('#a{}', 0);
Uncaught TypeError: CSSOM.parse is not a function
    at CSSGroupingRule.insertRule (/path/to/CSSOM/lib/CSSGroupingRule.js:41:22)

Now:

> rule.insertRule('#a{}', 0);
0
MrDOS commented 2 years ago

D'oh, I somehow didn't see https://github.com/NV/CSSOM/pull/113, which does the same thing as this.