3 ms·
Nice work. I like how it all stays declarative in the CSS too. I would recommend outsourcing your parsing though. It's a tough job and things like CSS hacks ca
by paulirish 15y ago
Nice work. I like how it all stays declarative in the CSS too.
I would recommend outsourcing your parsing though. It's a tough job and things like CSS hacks can really take your regexes for a loop.
I'd recommend trying out http://glazman.org/JSCSSP/ http://glazman.org/JSCSSP/ or https://github.com/nzakas/parser-lib/tree/master/src/css https://github.com/nzakas/parser-lib/tree/master/src/css which Nicholas uses for CSSLint.
- endtwist 15y agoI evaluated JSCSSP (didn't know about Parser-lib), but was trying to keep the file size down to a minimum. Though perhaps not the most robust, the library I'm using now (http://bililite.com/blog/2009/01/16/jquery-css-parser/ http://bililite.com/blog/2009/01/16/jquery-css-parser/) seems to work fine with all of what I've thrown at it. It is also, by far, the smallest of the three CSS parsing libraries (14kb vs JSCSSP's 165kb).