reltext
a bit of javascript which sets the font size of an element relative to the element's height
made with love by chase moskal
reltext usage
- install with npm —
npm install reltext
- add html classnames —
<div class="reltext">...</div>
- import into your code —
import reltext from "reltext"
- execute reltext with defaults —
reltext()
explicit usage with defaults
// elements to apply reltext onconst elements = document // font-size is 5% of the each element's heightconst fraction = 5 / 100 // apply reltext