Fitter, happier text. Apply text styles based on the shape of the text. Useful to apply styles based on a design system.
Usage
const textFit = const vdom = const hyperx = const hx = const text = 'The quick brown fox jumped over the lazy dog' const styles = const tree = hx` <h1 styles=></h1>` documentbody
API
textFit(text, opts)
Take a string, analyze the length, and determine the font size based on a scale. Takes the following options:
- opts.scale: pass in a scale of values to be set. Determines based on
.max
if the values should be applied on the text.
Installation
$ npm install text-fit