UNPKG

fitter-js

Version:

Simple text fitting, supports shadow DOM

41 lines (30 loc) 661 B
# Fitter > Simple text fitting, supports shadow DOM - <a href="https://roquef.github.io/Fitter.html" target="_blank">Example</a> - <a href="https://roquef.github.io/Fitter_Responsive.html" target="_blank">Responsive Example</a> ### Install: ```console npm i fitter-js ``` ### Basic usage: ```javascript new Fitter({ min: 12, // px max: 32, // px element: '.js-fitter' // selector string or node }); ``` ### With shadow DOM: ```javascript let fitter = new Fitter({ shadowRoot: yourShadowRoot }); ``` ### Update: ```javascript fitter.fit(); ``` ### Set: ```javascript fitter.set({ min: 10 }); ```