liup a01a5aa773 | 3 weeks ago | |
---|---|---|
.. | ||
coverage | 3 weeks ago | |
dist | 3 weeks ago | |
CHANGELOG.md | 3 weeks ago | |
LICENSE | 3 weeks ago | |
README.md | 3 weeks ago | |
package.json | 3 weeks ago |
Parses the CSS font property.
$ npm install parse-css-font [--save[-dev]]
const 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.