postcss-vertical-rhythm
A PostCSS plugin to create a custom vertical rhythm unit from the base font-size and line-height.
Examples
Set the font on the body selector using the CSS shorthand method, you can use either px
, em
, rem
or %
unit for font-size:
This will create a line-height of 32px, which will be the vertical rhythm value. Now you can use the custom vertical rhythm unit, vr
:
Input:
Output:
Options
Type: Object | Null
Default:
rootSelector: 'body'
rootSelector
(String) The root selector for thefont
declaraion.
Usage
Install:
npm install postcss-vertical-rhythm --save-dev
Then include the plugin:
See PostCSS docs for examples for your environment.
Licence
Released under the MIT license.