parse-css-font
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

parse-css-font

NPM version npm license Travis Build Status codecov BundlePhobia Minified BundlePhobia Minified + gzip code style: prettier Unicorn Approved

npm

Parses the CSS font property.

Installation

$ npm install parse-css-font [--save[-dev]]

Usage

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.

ES6/2015 import

import parseCSSFont from 'parse-css-font'

Testing

$ npm test

This will run tests and generate a code coverage report. Anything less than 100% coverage will throw an error.

/parse-css-font/

    Package Sidebar

    Install

    npm i parse-css-font

    Weekly Downloads

    21,415

    Version

    4.0.0

    License

    MIT

    Unpacked Size

    61.6 kB

    Total Files

    17

    Last publish

    Collaborators

    • jedmao