text-balancer

1.0.5 • Public • Published

text-balancer

Text-balancer is a javascript module that seeks to eliminate typographic widows from text. It does this by setting the max-width of the dom node to the threshold that it would spill onto another line.

How to run it

import textBalancer from 'text-balancer';

// Run it when you want to with any set of selectors
textBalancer.balanceText('.headline, .interactive-leadin, #horse-god');

// OR: Just run it and it will look for anything with the balance-text class
textBalancer.balanceText();

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.5
    849
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.5
    849
  • 1.0.4
    0
  • 1.0.3
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i text-balancer

Weekly Downloads

689

Version

1.0.5

License

MIT

Last publish

Collaborators

  • liddiard
  • mbeswetherick