reltext
TypeScript icon, indicating that this package has built-in type declarations

0.0.0-dev.2 • Public • Published

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

  1. install with npmnpm install reltext
  2. add html classnames<div class="reltext">...</div>
  3. import into your codeimport reltext from "reltext"
  4. execute reltext with defaultsreltext()

explicit usage with defaults

// elements to apply reltext on
const elements = document.querySelectorAll(".reltext")
 
// font-size is 5% of the each element's height
const fraction = 5 / 100
 
// apply reltext
reltext(elements, fraction)

Readme

Keywords

Package Sidebar

Install

npm i reltext

Weekly Downloads

1

Version

0.0.0-dev.2

License

ISC

Unpacked Size

7.8 kB

Total Files

12

Last publish

Collaborators

  • chasemoskal