Skip to content

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

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENCE.txt
Notifications You must be signed in to change notification settings

immortal-science/ts-compass-vertical-rhythm

 
 

Repository files navigation

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>
  }
});

About

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

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENCE.txt

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 97.0%
  • JavaScript 3.0%