adaptable-text:将字体大小调整为指定的宽度

时间:2024-05-20 05:30:56
【文件属性】:

文件名称:adaptable-text:将字体大小调整为指定的宽度

文件大小:31KB

文件格式:ZIP

更新时间:2024-05-20 05:30:56

javascript responsive text font-size JavaScript

适应性文本 将字体大小调整为指定的宽度。 安装 npm install adaptable-text 用法 import AdaptableText from "adaptable-text" ; const textToAdapt = new AdaptableText ( document . querySelector ( ".textToAdapt" ) , { step : 0.1 , minFontSize : 10 , width : null , } ) ; textToAdapt . init ( ) ; // Adapt const adapt = ( ) => { textToAdapt . setWidth ( ) ; textToAdapt . adapt ( ) ; } ; // Listen for a resize event wind


【文件预览】:
adaptable-text-main
----.gitignore(33B)
----README.md(5KB)
----CHANGELOG.md(494B)
----package.json(916B)
----index.js(4KB)
----LICENSE.md(1KB)
----web_modules()
--------clamp.js(199B)
--------es-module-shims.js(82KB)
--------import-map.json(95B)
----.npmignore(100B)
----.editorconfig(147B)
----index.html(4KB)
----package-lock.json(2KB)

网友评论