/Fitter

text fitting, supports shadow DOM

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

Fitter

Simple text fitting, supports shadow DOM

Install:

npm i fitter-js

Basic usage:

new Fitter({
    min: 12, // px
    max: 32, // px
    element: '.js-fitter' // selector string or node
});

With shadow DOM:

let fitter = new Fitter({
    shadowRoot: yourShadowRoot
});

Update:

fitter.fit();

Set:

fitter.set({ min: 10 });