Communitygithub.com

xzedm/clipplic-landing

Web 排版:涵盖字体选择、间距、换行与可访问性。用于挑选或搭配字体、配置可变字体或 OpenType 特性、构建字号层级、检查标题层级、组件内文本样式、文本截断、下划线、选区、占位符与光标样式,或审查前端代码中的排版问题。触发关键词包括:排版、字体、字体格式、woff2、可变字体、font-weight、opentype、font-feature-settings、letter-spacing、line-height、字号层级、标题层级、标题级别、tabular numbers、text-wrap、截断、line clamp、下划线、text-decoration、文本选择、iOS 输入缩放、缩放后的输入文本、字体平滑、文本对比度、行长、行长度、text-box、智能标点、首字下沉。

clipplic-landing 是什么?

这是一个专注于 Web 排版的 AI 技能,旨在帮助开发者或审阅者在构建和审查包含文本的前端界面时,应用专业且一致的排版原则。它涵盖了从字体格式选择(如 .woff2)、可变字体与 OpenType 特性的正确使用(优先使用高级 CSS 属性)、构建合理的字号层级与行高,到精细控制文本换行、截断、下划线、选区样式等细节。该技能强调“节制”与“系统性”,主张使用项目已有的样式系统(如 Tailwind 或 CSS Modules)来表达所有修改,避免引入不必要的第二种样式方案。此外,它还针对移动端(如 iOS 输入缩放)、对比度、语言与文本方向(bidi)等可访问性问题提供了具体指导。最终,该技能可以输出结构化的审查报告,将发现的排版问题按严重程度分级并给出可操作的修复建议。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/xzedm/clipplic-landing/tree/HEAD/.agents/skills/better-typography

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

卓越排版

好的排版大多在于节制。合理的字号层级、舒适的间距和足够的对比度,胜过任何花哨的效果。标签、表格单元格、营销标题和文章段落不应共用一套规则。在构建或审查任何包含文本的内容时,请应用这些原则。

审查时,读取页面内容而非扫描代码:眯眼检查层级是否成立,通读一个完整段落以感受舒适度,并调整视口大小以观察在实际内容长度下是否出现糟糕的换行、孤行和截断。

词语本身(按钮标签、错误消息、空状态)由 better-writing 技能覆盖;语义化标题结构由 better-accessibility 覆盖;空间 RTL 布局和逻辑 CSS 属性由 better-layout 覆盖;渲染对对比度测量和颜色修复由 better-colors 覆盖。本技能负责文本在混合方向内容中如何渲染、换行及表现。

匹配项目的样式系统。 在建议或编写任何修复之前,检查代码库如何设置样式,并以该样式系统表达所有更改:在 Tailwind 项目中使用 Tailwind 工具类,在 CSS、CSS Modules、styled-components 或 StyleX 中使用纯声明。速查表 将每个声明映射到其 Tailwind 等效项。切勿仅为应用排版修复而引入第二种样式方法。

快速参考

类别使用时机参考文档
选择字体字体类别、搭配、格式、字型解剖choosing-fonts.md
可变字体与 OpenType轴、字重、表格数字、样式集variable-fonts-and-opentype.md
间距与尺寸字号层级、标题层级、行高、字间距、文本修剪spacing-and-sizing.md
换行与标点行长、换行、截断、智能标点、RTLwrapping-and-punctuation.md
细节与可访问性下划线、选区、表单、装饰性文本、对比度details-and-accessibility.md
CSS 速查表快速查找每个涉及的属性及其 Tailwind 等效项css-cheat-sheet.md

核心原则

1. 提供正确的格式

在 Web 上使用 .woff2(Brotli 压缩,广泛支持)。.woff 仅作为非常老旧浏览器的备用方案;.ttf 和 .otf 是未经 Web 压缩的原始桌面格式。文件如何加载是项目自身的问题,本技能不做规定。

2. 优先使用高级属性而非原始标签

当 CSS 属性存在时,请使用它。使用 font-weight: 650 而非 font-variation-settings: "wght" 650,使用 font-optical-sizing: auto 而非 "opsz",使用 font-variant-numeric: tabular-nums 而非 font-feature-settings: "tnum" 1。这些高级属性在非可变字体回退时仍然有效。将原始标签属性保留给自定义轴("GRAD" 80)和没有对应高级属性的小众特性("ss01" 1)。

3. 加载预期的字重与字形

浏览器可能会综合生成当前字体族未提供的请求字重或字形。最好加载设计实际使用的字面。仅在验证了所有必需的粗体、斜体、小型大写、上标和下标形式在整个回退字体堆栈中保持视觉差异之后,才设置 font-synthesis: none;禁用合成并非诊断手段,不得抹除强调效果。

4. 减少字体、字号和字重的种类

极少使用超过三种字体。字重和字号定义了层级,但过度使用会迅速损害可读性。为对比而非相似而搭配:衬线标题搭配无衬线正文显得深思熟虑,两个几乎相同的无衬线字体则像是错误。在 18px 以下,保持字重在 400 及以上;低于 300 的字重仅用于展示(28px 及以上),它们在文本大小下会消失。

5. 使用带语义名称的字号层级

定义一小套字号,并尽可能少地偏离它。没有系统的硬编码字号在规模扩展时会崩溃。对于个人项目,像 text-sm 这样的默认名称只要用法规则清晰就很好用。在团队中,应按用途(text-body-sm)而非尺寸来命名字号,以保持规则一致。

6. 标题尺寸随层级递减

在连贯的页面层级中,将标题层级映射到字号层级中递减的步骤:一个视觉上从属的标题不应意外地压倒其父标题。相邻级别在层级向小端发展时可以共享一个尺寸,只要字重或间距能保持它们区分。根据 better-accessibility 选择语义化的标题元素;本技能仅控制其视觉处理。

7. 根据角色设定行高

标题更紧凑,大约 1.1。正文 1.5 到 1.6。优先使用无单位值,以便行高随字号缩放;像 24px 这样的固定值则不会。紧凑的行高适用于短文本:任何换行超过三行的文本至少需要 1.4,即使在高度受限的行中也是如此。

8. 根据尺寸设定字间距

大标题通常看起来略带负字间距效果更好。小写标签需要一点正字间距,以避免字母显得拥挤。阅读尺寸下的正文则两者都不需要。

9. 限制行长

长行使得眼睛难以找到下一行。将长文本的行长限制在大约每行 60–75 个字符。任何单位都行:65ch 直接按字符测量,而像素或 rem 限制也同样有效:在 16px 正文大小下,该范围大致落在 560px 和 680px 之间,具体取决于字体,因此 Tailwind 的 max-w-xl 或 max-w-2xl 就很合适。重要的是存在一个限制,并且最终的行长在范围之内。

10. 有目的地换行

text-wrap: balance 均匀分布文本到各行:用于标题。text-wrap: pretty 避免在最后一行只留下一个短单词:用于描述。在长格式文本中两者都跳过:浏览器无论如何都会忽略超过几行的 balance,而均匀化整个段落会浪费空间并使其更难阅读。当长单词、链接或 ID 可能溢出容器时,使用 overflow-wrap: break-word。在换行会显得破损的标签和徽章上,使用 white-space: nowrap。

11. 在变化的值上使用表格数字

默认情况下数字宽度不同,因此计时器、计数器和价格在更新时会改变布局。对任何变化的值应用 font-variant-numeric: tabular-nums。

12. 截断而不丢失内容

单行:使用 text-overflow: ellipsis 配合 overflow: hidden 和 white-space: nowrap。多行:使用 line-clamp。截断会隐藏内容,因此如果缺失的文本很重要,请在工具提示或展开视图中保留完整值。

13. 自然地编写文案,用 CSS 设置样式

以自然大小写存储文本,并用 text-transform 控制呈现,这样重新设计时永远不需要重写文案。使用智能标点:散文中使用弯引号(代码中使用直引号),表示范围如 2010–2020 使用短破折号,表示思绪转折使用长破折号,使用单个省略号字符,使用   将如 16 px 的值保持在一起,使用 ­ 控制长单词可能断开的位置。

14. 来源于字体的下划线

默认下划线由浏览器决定其位置。使用 text-underline-position: from-font 和 text-decoration-thickness: from-font 从字体自身的度量中获取位置和粗细,或使用 text-decoration-thickness、text-underline-offset 和 text-decoration-skip-ink 手动调整。text-decoration-style 将线条绘制为点线、虚线或波浪线;点线是一种常见的提示,表明单词带有额外信息,例如缩写或定义的术语。除非唯一动画的是颜色变化,否则应将下划线构建为单独的元素,而不是使用 text-decoration:颜色是真实下划线中唯一能可靠动画的部分。

15. 移动端输入框字体大小设为 16px

当 iOS Safari 中输入框的文本小于 16px 时,它会缩放整个页面。两种修复方法以不同方式将字体大小保持在 16px,因此应询问设计需要哪一种,而不是静默选择:在移动设备上放大输入框(text-base sm:text-sm),这会改变其在小屏幕上的外观;或者保持 font-size: 16px 并使用 transform: scale() 渲染预期大小,同时补偿宽度和 line-height,使设计在每个视口下都相同。两种方法。

16. 尺寸与对比度底线

长形式正文文本从接近浏览器默认的 16px 开始,然后在实际的字型、行长、平台和产品密度中进行判断。UI 文本可以更小:14px 对于输入框和菜单来说是一个有用的起点(输入框在移动端仍需 16px,参见原则 15),13px 用于说明文字,很少低于 12px。当文本看起来对比度低时,使用 better-colors 测量渲染对,使用 better-accessibility 分类需求;除非被要求,否则不要更改颜色。

17. 在根元素上应用字体平滑

在 macOS 上文本渲染得比预期更粗。在根布局上一次性地应用 -webkit-font-smoothing: antialiased 和 -moz-osx-font-smoothing: grayscale(两者都由 Tailwind 的 antialiased 覆盖),以便它们覆盖所有文本。

18. 语言与双向文本行为

设置 lang 以便浏览器和辅助技术选择正确的发音、引号和断字。在方向改变或需要保持数字顺序时在文档或内容边界设置 dir,并在需要时为隔离的混合方向值使用 <bdi>。空间镜像和逻辑 CSS 属性属于 better-layout。

19. 保持有用的文本可选

当选中的组合保持清晰易读时,::selection 可以将品牌带入阅读体验。默认保持文本可选中。仅在特定的可拖拽或手势驱动的表面上,当意外选择明显干扰交互时才使用 user-select: none;切勿跨界面禁用选择,或仅仅因为按钮标签可以被高亮而禁用。

常见错误

错误修复
在 Web 上提供 .ttf/.otf转换为 .woff2
使用 font-variation-settings: "wght" 控制字重使用 font-weight(与非可变回退兼容)
使用 font-feature-settings: "tnum" 1使用 font-variant-numeric: tabular-nums
合成字形与预期设计不同加载所需字面;仅禁用已验证的合成模式,不抹除强调效果
硬编码了单次使用的字号使用字号层级
子标题在视觉上压倒其父标题将该部分层级映射到递减的层级步骤
根据默认大小选择了标题元素使用 better-accessibility 选择语义,然后在 CSS 中设置视觉大小
在可缩放文本上使用 line-height: 24px使用无单位值(1.5)
全宽段落限制在每行 60–75 个字符
段落最后一行出现孤行使用 text-wrap: pretty
两行标题不平衡使用 text-wrap: balance
数字导致布局移位使用 tabular-nums
截断文本无法阅读完整值为完整值提供工具提示或展开视图
在文案中键入了 UPPERCASE使用自然大小写 + text-transform
界面中使用了两端对齐文本使用 text-align: start;保留两端对齐用于特定的编辑版式
下划线穿过字母下伸部分使用 text-decoration-skip-ink: auto、from-font 度量
iOS 上低于 16px 的输入框缩放先询问:使用 text-base sm:text-sm,或使用 16px 并通过 transform 缩放以保持设计尺寸
根布局缺少字体平滑在根元素应用一次 antialiased
混合方向值以错误顺序渲染设置正确的 lang/dir;在需要时使用 <bdi> 隔离值
在应用程序界面中禁用了选择恢复选择;仅在与拖拽或手势冲突的特定交互上抑制选择
额外信息提示没有视觉提示通过 text-decoration-style: dotted 使用点线下划线
在 14px UI 文本上使用细/轻字重18px 以下使用字重 400+;细字重仅用于展示
在三行卡片描述上使用 leading-none任何换行到 3 行以上的文本至少使用 1.4

审查输出格式

仅当用户要求进行独立的排版审查时使用此格式。当 better-interface 编排审查时,向该技能提供领域证据和发现,并让其输出格式、严重性等级、合并规则、上限和结论优先。

独立审查分为两部分呈现。

发现

将所有已确认的发现按原则分组。使用包含以下列的 Markdown 表格:严重性、位置、之前、之后和原因。绝不要使用分开的 "Before:" / "After:" 行。

  • 严重性:HIGH 使文本不可读、不可用或结构上误导;MEDIUM 损害层级、换行或扫描;LOW 是孤立的排版改进。
  • 位置:引用 path/to/file:line。如果工件没有源文件,则引用确切屏幕和组件。
  • 之前 / 之后:显示当前排版以及可行的替换方案。
  • 原因:指出违反的原则及其对可读性或层级的影响。

将重复的系统性问题合并为一行,并列出所有受影响的地址。省略没有发现的那些原则。

示例

表格数字

严重性位置之前之后原因
MEDIUMsrc/Price.tsx:17实时价格上的 <span>{price}</span><span className="tabular-nums">{price}</span>比例数字导致变化的值移位
LOWsrc/numbers.css:8font-feature-settings: "tnum" 1font-variant-numeric: tabular-nums高级属性保留了回退行为

行高与行长

严重性位置之前之后原因
MEDIUMsrc/Article.tsx:33正文段落上的 leading-noneleading-normal(1.5)正文需要宽松的行高以便在换行时保持可读性

| LOW | src/Content.tsx:12 | 容器没有 max-width | max-w-2xl | 未限制的行长使得长段落难以扫描 |

标点与引号

严重性位置之前之后原因
LOWsrc/Body.tsx:8引号中的 '...'弯引号 '...'智能标点改善阅读体验,与所陈述的设计风格保持一致

总结

呈现一个简短的摘要,但仅当用户特意要求时才包含。在 better-interface 编排时,由 better-interface 决定是否包含摘要。当独立使用时,如果没有发现任何问题,则不输出任何摘要;否则,仅在【发现】之后并应要求添加摘要。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

xzedm/clipplic-landing

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.

xzedm/clipplic-landing

Material Design 3 and Android platform guidelines. Use when building Android apps with Jetpack Compose or XML layouts, implementing Material You, navigation, or accessibility. Triggers on tasks involving Android UI, Compose components, dynamic color, or Material Design compliance.

xzedm/clipplic-landing

Apple's approach to interface design and fluid, physical motion, translated for the web. Use when building or reviewing gesture-driven UI, spring animations, drag/swipe/sheet interactions, momentum and interruptible transitions, translucent materials and depth, typography (optical sizing, tracking, leading), reduced-motion, or the design foundations (feedback, spatial consistency, restraint) behind Apple-style interfaces.

xzedm/clipplic-landing

Design iOS apps following Apple's Human Interface Guidelines. Generate native components, validate designs, and ensure accessibility compliance for iPhone, iPad, and Apple Watch.

xzedm/clipplic-landing

Redesign mobile app UI to feel unmistakably Apple-like, iOS-forward, and native. Use this skill when building iOS apps, applying Apple Human Interface Guidelines, or creating native-feeling mobile interfaces with SF Pro typography, translucency, and system-like components.

xzedm/clipplic-landing

Accessibility engineering for product interfaces, from focus states and keyboard support to ARIA, forms, and screen readers. Use when building or reviewing UI components, modals, menus, forms, custom widgets, or when the user says "make this accessible" or reports keyboard or screen-reader issues. Triggers on accessibility, a11y, WCAG, aria, focus ring, focus-visible, focus trap, keyboard navigation, tab order, tabindex, screen reader, sr-only, aria-live, alt text, hit area, touch target, prefers-reduced-motion, autoplay, toast duration, skip link, semantic HTML, aria-label, form errors, disabled buttons, "not keyboard accessible".

xzedm/clipplic-landing

OKLCH color space and color usage for web projects. Convert hex/rgb/hsl to oklch, generate palettes, check contrast, handle gamut boundaries, theme with Tailwind v4, and apply color with meaning. Triggers on oklch, color conversion, palette generation, contrast ratio, gamut, display p3, design tokens, semantic color tokens, hue drift, chroma, dark mode colors, accent color, color meaning, light and dark appearance, increased contrast.

xzedm/clipplic-landing

Layout structure for web interfaces, from grouping and alignment to reading order, progressive disclosure, and adaptive breakpoints. Use when structuring a page or component, spacing or aligning controls, deciding what collapses at small sizes, handling RTL layout direction, or reviewing frontend code for layout. Triggers on layout, spacing, alignment, grouping, negative space, whitespace, visual hierarchy, reading order, progressive disclosure, breakpoints, responsive layout, container queries, safe area, full-bleed, edge-to-edge, layout margins, RTL layout, logical properties.

xzedm/clipplic-landing

Design engineering principles for making interfaces feel polished. Use when building UI components, reviewing frontend code, implementing animations, hover states, shadows, borders, micro-interactions, enter/exit animations, choosing or reviewing icons, or any visual detail work. Triggers on UI polish, design details, "make it feel better", "feels off", stagger animations, border radius, optical alignment, image outlines, box shadows, icons, icon stroke weight, icon states, motion restraint.

xzedm/clipplic-landing

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

xzedm/clipplic-landing

Generate developer handoff specs from a design. Use when a design is ready for engineering and needs a spec sheet covering layout, design tokens, component props, interaction states, responsive breakpoints, edge cases, and animation details.

xzedm/clipplic-landing

This skill encodes Emil Kowalski's philosophy on UI polish, component design, animation decisions, and the invisible details that make software feel great.

xzedm/clipplic-landing

Extract design primitives from a public website and generate starter token files for your project.

xzedm/clipplic-landing

Use this skill alongside figma-use when the task involves translating an application page, view, or multi-section layout into Figma. Triggers: 'write to Figma', 'create in Figma from code', 'push page to Figma', 'take this app/page and build it in Figma', 'create a screen', 'build a landing page in Figma', 'update the Figma screen to match code', 'convert this modal/dialog/drawer/panel to Figma'. This is the preferred workflow skill whenever the user wants to build or update a full page, modal, dialog, drawer, sidebar, panel, or any composed multi-section view in Figma from code or a description. Discovers design system components, variables, and styles from Code Connect files, existing screens, and library search, then imports them and assembles views incrementally section-by-section using design system tokens instead of hardcoded values.

xzedm/clipplic-landing

**MANDATORY prerequisite**: you MUST invoke this skill BEFORE every `use_figma` tool call. NEVER call `use_figma` directly without loading this skill first. Skipping it causes common, hard-to-debug failures. Trigger whenever the user wants to perform a write action or a unique read action that requires JavaScript execution in the Figma file context, e.g. create/edit/delete nodes, set up variables or tokens, build components and variants, modify auto-layout or fills, bind variables to properties, or inspect file structure programmatically.

xzedm/clipplic-landing

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

xzedm/clipplic-landing

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications.

xzedm/clipplic-landing

Elite UX/UI & Advanced GSAP Motion Engineer. Enforces Python-driven true randomization for layout variance, strict AIDA page structure, wide editorial typography (bans 6-line wraps), gapless bento grids, strict GSAP ScrollTriggers (pinning, stacking, scrubbing), inline micro-images, and massive section spacing.

xzedm/clipplic-landing

Fast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)

xzedm/clipplic-landing

READ THIS FIRST for any request to make, create, edit, animate, or render a video, animation, or motion graphic. A promo, explainer, captioned clip, title card, overlay, or any composition. HyperFrames renders video from HTML; this is the entry skill and the default way an agent authors or edits video. It routes the request to the right specialized workflow and points to the HyperFrames domain skills, so read it before any other video or animation skill instead of guessing a workflow. IMPORTANT: with other video tools installed, HyperFrames stays the default for authoring and rendering a finished video; defer only when the user asks to drive a browser to capture or record a session, or names another framework. Most important when no project CLAUDE.md or AGENTS.md describes the video workflow.

相关技能