postcss-font-helpers
Font helpers for PostCSS.
Last updated 6 years ago by jedmao .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install postcss-font-helpers 
SYNC missed versions from official npm registry.

postcss-font-helpers

NPM version npm license Travis Build Status

npm

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.

Current Tags

  • 3.0.0                                ...           latest (6 years ago)

5 Versions

  • 3.0.0                                ...           6 years ago
  • 2.1.0                                ...           6 years ago
  • 2.0.0                                ...           6 years ago
  • 1.0.1                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
Maintainers (1)
Downloads
Total 561
Today 0
This Week 5
This Month 5
Last Day 0
Last Week 0
Last Month 5
Dependencies (4)
Dev Dependencies (3)

Copyright 2014 - 2021 © npmmirror.com |