Parses the CSS font property.
$ npm install parse-css-font [--save[-dev]]
var parseCSSFont = require('parse-css-font');
parseCSSFont('1rem "Roboto Condensed", sans-serif;');
/*
{
size: '1rem',
family: ['Roboto Condensed', 'sans-serif'],
style: 'normal',
variant: 'normal',
weight: 'normal',
stretch: 'normal',
lineHeight: 'normal'
}
*/
See the tests for more scenarios.
import parseCSSFont from 'parse-css-font';
$ npm test
This will run tests and generate a code coverage report. Anything less than 100% coverage will throw an error.