fit-html-text
TypeScript icon, indicating that this package has built-in type declarations

0.2.4 • Public • Published

fit-html-text

CI

Fit text into its surrounding container.

Usage

import { fitText } from "fit-html-text";

const element = document.getElementById("myElement");

fitText(element, {
    fontMinSize: 8,
    fontMaxSize: 72,
    containerMaxWidth: 300,
    containerMaxHeight: 300,
    multipleLines: false,
});

Usage for Browsers

Source

Demo Page

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i fit-html-text

Weekly Downloads

4

Version

0.2.4

License

MIT

Unpacked Size

9.35 kB

Total Files

5

Last publish

Collaborators

  • magiclen