Skip to content

BarryThePenguin/postcss-typography

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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