Skip to main content
在 Manus 中运行任何 Skill
一键导入

pretext

Help developers use @chenglou/pretext, a small TypeScript text measurement library that computes exact text metrics without DOM reflows. Use when users mention pretext, @chenglou/pretext, @chenglou/pretext/rich-inline, measuring text height without triggering DOM reflow, measuring text height or line count in JS, auto-fitting font size to a container, flowing text around obstacles or images, laying out text per-line with variable widths, computing the natural/widest line width of a paragraph, rich inline runs with chips or mentions, layoutNextLine, or layoutNextLineRange. Covers API usage, integration patterns, and gotchas (lineHeight must be CSS pixels, font loading timing, system-ui caveats, ESM-only packaging). Do NOT use for CSS-only text layout questions, generic typography advice, or unrelated "shrink-to-fit" CSS questions.

概览

Help developers use @chenglou/pretext, a small TypeScript text measurement library that computes exact text metrics without DOM reflows. Use when users mention pretext, @chenglou/pretext, @chenglou/pretext/rich-inline, measuring text height without triggering DOM reflow, measuring text height or line count in JS, auto-fitting font size to a container, flowing text around obstacles or images, laying out text per-line with variable widths, computing the natural/widest line width of a paragraph, rich inline runs with chips or mentions, layoutNextLine, or layoutNextLineRange. Covers API usage, integration patterns, and gotchas (lineHeight must be CSS pixels, font loading timing, system-ui caveats, ESM-only packaging). Do NOT use for CSS-only text layout questions, generic typography advice, or unrelated "shrink-to-fit" CSS questions.

安装命令
npx skills add https://github.com/yaniv-golan/pretext-skill --skill pretext

复制此命令并粘贴到 Claude Code 中以安装该技能

星标14
分支0
更新时间2026年5月15日 20:51
文件资源管理器
4 个文件
SKILL.md
readonly