Package Exports
- postcss-font-helpers
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (postcss-font-helpers) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
postcss-font-helpers
Font helpers for PostCSS.
Installation
$ npm install postcss-font-helpers [--save[-dev]]
Usage
var postcss = require('postcss');
var font = require('postcss-font-helpers');
var rule = postcss.parse([
'a {',
' line-height: 1;',
' font: 1rem/1.2 serif;',
' font-size: .8rem;',
'}'
].join('')).first;
// Get all props
font(rule); /*
{
size: ".8rem",
line-height: 1.2,
family: ["serif"]
}
*/
// Get individual props
font.lineHeight(rule); // 1.2
font.size(rule); // ".8rem"
font.family(rule); // ["serif"]
See the tests for more scenarios.
Testing
$ npm test
This will run tests and generate a code coverage report. Anything less than 100% coverage will throw an error.