Skip to content

BarryThePenguin/postcss-typography

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

postcss-typography Build Status Coverage Status

A postcss plugin for typography.js

Installation

npm:

npm install postcss-typography

Usage

Dependencies:

var postcss = require('postcss');
var typography = require('postcss-typography');

Use:

var processor = postcss().use(typography(options));

Process:

processor.process(css).then(function (result) {
  console.log(result.css);
});

Yields:

* {
  ...
}
*:before {
  ...
}
*:after {
  ...
}
body {
  ...
}
img {
  ...
}
h1 {
  ...
}
h2 {
  ...
}
...

API

typography([options])

options

Options to pass through to the typography api

@typography

This plugin will replace the @typography “at-rule” with the output of typography.js. Any declarations within the at-rule block will be merged with the final css output.

License

MIT © Jonathan Haines