webfont-format
它能做什么
这个技能检查网站加载的字体文件,并建议更快的格式和加载设置。它面向关心页面速度的设计师和开发者。
适用场景
- ✓网站加载的旧版字体格式比实际需要大的时候。
- ✓字体加载期间文字一直不可见的时候。
- ✓性能审计显示字体文件拖慢首屏显示的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/webfont-format/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的网站使用了几种自定义字体,文字出现得很慢。请帮我让字体加载得更快吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会检查样式表中的字体格式和 font-display 设置。它会建议使用带备用方案的 WOFF2、预加载关键字体,并去掉未使用的字符。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Optimize web font formats
Modern font formats reduce file sizes by 30-50%—directly improving page load speed and Core Web Vitals scores.
Quick Reference
- Use WOFF2 as primary format (~30% smaller than WOFF)
- Include WOFF fallback for older browsers
- Apply font-display: swap for better perceived performance
- Preload critical fonts and subset to reduce file sizes
Check
Verify that web fonts use modern formats (WOFF2, WOFF) with proper fallbacks and are optimized for performance with font-display and preloading strategies.
Fix
Convert fonts to WOFF2/WOFF formats, implement proper font loading strategies, and optimize font delivery with compression and caching.
Explain
Explain how modern web font formats reduce file sizes, improve loading performance, and provide better browser support compared to legacy formats.
Code Review
Review stylesheets, component styles, and responsive states related to Optimize web font formats. Flag exact selectors, declarations, or breakpoints that violate the rule in the rendered UI.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/css/webfont-format
常见问题
为什么优先使用 WOFF2?
这个技能说,WOFF2 大约比 WOFF 小 30%,因此下载更快。
font-display: swap 有什么作用?
它会立即显示备用文字,并在自定义字体准备好后替换为它。
什么是字体子集化?
它只保留你需要的字符,从而让字体文件更小。
详情
作者的原始描述
Use when reviewing stylesheets, component styles, and responsive behavior related to Optimize web font formats. Check the rendered layout across breakpoints and interaction states before proposing a fix.
热度
- GitHub 星标
- 75k
- 排名
- #3085
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。