I need to parse the CSS font shorthand format into the separate components (font-family, font-size, font-weight, …). This shorthand format looks pretty complicated. Here are two examples:
10px sans-serif
bold italic small-caps 1em/1.5em verdana,sans-serif
Before I start writing a parser for it, is there an already existing parser out there I could use (Preferably written in JavaScript)?
Here’s a “temporary DOM element and using jquery’s css() function” solution:
http://jsfiddle.net/thirtydot/tpSsE/2/