All Projects → KyleAMathews → compass-vertical-rhythm

KyleAMathews / compass-vertical-rhythm

Licence: MIT license
A port-in-progress of the Compass vertical rhythm library

Programming Languages

coffeescript
4710 projects
javascript
184084 projects - #8 most used programming language
Makefile
30231 projects

compass-vertical-rhythm

A port-in-progress of the Compass vertical rhythm library.

Only the rhythm function has been ported atm.

Install

npm install compass-vertical-rhythm

Usage

var VerticalRhythm = require('compass-vertical-rhythm');

var rhythm = VerticalRhythm({baseFontSize: '24px', baseLineHeight: 1.5}).rhythm;

rhythm(1);
// ---> 1.25rem

rhythm(0.5);
// ---> 0.625rem

rhythm(0.25);
// ---> 0.3125rem

// Use it for React inline styles.
React.createClass({
  render: function() {
    <div style={{margin: rhythm(1)}}>
      Hello world
    </div>
  }
});
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].