项目
在 GitHub 查看
jxnblk/fitter-happier-text
关于
高性能、完全流式的标题样式
其他项目实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- -1
- 1个月
- -3
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Fitter Happier Text
Performant, fully fluid headings
Usage
Include dist/fitter-happier-text.js in your project or install from NPM:
npm install fitter-happier-text
(or download it https://github.com/jxnblk/fitter-happier-text/archive/0.0.1.zip)
Pass it a nodelist.
var nodes = document.querySelectorAll('[data-fitter-happier-text]');
fitterHappierText(nodes);
Fitter Happier Text replaces each node with an SVG text node and sets the viewBox attribute based on its width and height.
To adjust for different fonts, use the baseline and paddingY options. paddingY can be set to a negative value to reduce the height of the SVG container.
fitterHappierText(nodes, { baseline: 14, paddingY: 2 });
Browser support:
Please note: I do not plan on adding any SVG polyfills to handle old browsers.
MIT License
探索相关项目
加载中…