Communitygithub.com

xzedm/clipplic-landing

網頁排版技能:從字體選擇到間距、換行與無障礙設計。適用於挑選或搭配字型、設定可變字型或 OpenType 功能、建立字級比例、檢查標題層級、在元件中設定文字樣式、截斷文字、設定底線、選取範圍、佔位符號或游標樣式,以及審查前端程式碼的排版問題。

clipplic-landing 是什麼?

這個技能專注於網頁排版最佳化,涵蓋字體選擇、間距、換行與無障礙設計等多個面向。它提供完整的排版原則與實作指南,包括使用正確的字體格式(如 woff2)、偏好的 CSS 屬性(如 font-weight 而非 font-variation-settings)、建立一致的文字大小系統、控制行高與字距、設定適合閱讀的欄寬(約 60-75 字元)、以及處理文字截斷與換行。同時也注重無障礙細節,如 iOS 輸入縮放、字體平滑處理、文字對比度等。支援 Tailwind CSS、純 CSS、CSS Modules、styled-components 與 StyleX 等多種技術棧,並提供 CSS 速查表對應各屬性的 Tailwind 等價寫法。

相容平台~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. 提供正確的格式

在網路上使用 .woff2(Brotli 壓縮,廣泛支援)。.woff 僅作為非常舊的瀏覽器的備用方案;.ttf 與 .otf 是不含網路壓縮的原始桌面格式。檔案如何載入是專案本身的考量,本技能不強制規定。

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 使用 en dash,設置想法時使用 em dash,單一省略符號字元,使用   保持如 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

當輸入框的文字小於 16px 時,iOS Safari 會縮放整個頁面。有兩種修正方式以不同方式將字體大小保持在 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;永遠不要跨介面停用選取,或僅因為按鈕標籤可以被反白就這麼做。

常見錯誤

錯誤修正
在網路上提供 .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
截斷的文字無法閱讀為完整值提供工具提示或展開檢視
在文案中輸入 大寫自然大小寫 + text-transform
介面中文字對齊使用 text-align: start;保留 justify 給特定編輯版面
底線穿過下降部使用 text-decoration-skip-ink: auto、from-font 度量
低於 16px 的輸入框在 iOS 上縮放先詢問:text-base sm:text-sm,或使用 transform 縮小 16px 以保持設計尺寸
根佈局省略字體平滑在根元素套用 antialiased 一次
混合方向值以錯誤順序渲染設定正確的 lang/dir;需要時使用 <bdi> 隔離該值
跨應用程式 chrome 停用選取恢復選取;僅在特定與拖曳或手勢衝突的互動上抑制選取
沒有視覺提示的額外資訊提示使用 text-decoration-style: dotted 的點線底線
在 14px UI 文字上使用細/輕字重低於 18px 使用字重 400+;細字重僅用於顯示
在三行卡片描述上使用 leading-none任何換行到 3 行以上的文字至少需要 1.4

審查輸出格式

僅當使用者要求獨立的排版審查時使用此格式。當 better-interface 協調審查時,請將領域證據和發現提供給該技能,並讓其輸出格式、嚴重性分級、合併規則、上限和結論優先。

以兩部分呈現獨立審查。

發現

按原則分組所有確認的發現。使用包含嚴重性、位置、修改前、修改後和原因欄位的 Markdown 表格。永遠不要使用獨立的「修改前:」/「修改後:」行。

  • 嚴重性: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)緊湊行高是為短文字設計的;包裹三行以上的文字需要更多空間才能舒適閱讀

摘要與建議

在發現之後,提供兩個明確的陳述性段落:第一個總結需要更正以符合這些原則的最關鍵問題,第二個對任何無法立即修正的結構性問題給出方向,例如「此設計未定義字級比例」或「未載入粗體字型」。每個段落都精確到足以獨立操作——不要在兩個段落中重複相同的診斷或建議。

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.

相關技能