跳到正文
Skillpedia
界面(UI/UX)48k · #6268

design-system

它能做什么

这个工具可以帮助确保网站的视觉元素(比如颜色、字体排版和动画)实现得统一且高效。它会设定规则,让整个网站的外观和表现保持一致。

适用场景

  • ✓当你在搭建新网站或新应用时。
  • ✓当你要为现有网站添加新的视觉功能时。
  • ✓当你希望网站拥有统一的外观和体验时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/skills/design-system/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/skills/design-system/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我该怎样确保整个网站的颜色和字体保持一致?”

每周 5 个新技能,1 分钟读完。

工作原理

它的做法是为颜色、字体排版和动画定义“tokens”(即一小段代码形式的设计变量)。代码不再使用随意的数值,而是统一调用这些预先定义好的 tokens,从而保证一致性。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Design system

When to Use

Use this skill when you need mechanical implementation invariants for frontend design: token architecture, typography hierarchy, loading order, FOUT prevention, chrome stability, motion timing, color semantics. Use with design when building components, pages, or design systems. (Aesthetic direction lives in...

Apply with design when implementing UI: components, pages, or design systems. Every color, type, and motion choice should trace back to these rules.

Token architecture

All colors map to a small set of primitives. No random hex values.

  • Foreground: Text hierarchy (primary, secondary, muted).
  • Background: Surface elevation (base, raised, overlay).
  • Border: Separation hierarchy (subtle, default, emphasis).
  • Brand: Identity and primary accent.
  • Semantic: Destructive, warning, success (and optional info).

Use tokens in code (CSS variables, theme objects); never hardcode hex for UI.

Typography

  • Hierarchy: Headlines — heavier weight, tighter letter-spacing for presence. Body — comfortable weight for readability. Labels/UI — medium weight, works at smaller sizes. Data — monospace, tabular-nums for alignment.
  • Combine size, weight, and letter-spacing so hierarchy is clear at a glance. If you squint and can't tell headline from body, hierarchy is too weak.
  • Fonts: pair a display font with a body font; keep hierarchy legible at a glance. Which fonts is direction, not mechanics — pick from the domain and push off your first/default instinct (the mean); see design-spatial §2.
  • Data (functional only): real aligned numbers, IDs, timestamps in monospace with tabular-nums — mono earns its place when values line up in a column. Do NOT sprinkle mono on decorative eyebrow/metadata microtext ("35MM · DEVELOP · SCAN", fake spec captions) for a "technical" look — that's the current trend-slop, not data. See design-spatial §2.

Loading order — first seen, first loaded

The first viewport must paint complete and correct, fast. Order every resource by whether the user sees it first; the rest waits.

  • Prioritize only the above-the-fold set (hero text, hero image/video, brand mark). Preloading everything is the same as preloading nothing — the true criticals lose the bandwidth race. Pick the few things in the first screenful and prioritize those.
  • Fonts: self-host WOFF2. Convert OTF/TTF → WOFF2 (Brotli; ~half the bytes, identical glyphs) and <link rel="preload" as="font" type="font/woff2" crossorigin> the weights used in the first viewport. Never a render-blocking third-party font stylesheet — a Google Fonts <link> adds a CSS round-trip plus extra DNS/TLS before the font even starts downloading; self-host instead.
  • LCP image/video: fetchpriority="high" on the hero image (or the video poster); <link rel="preload" as="image"> it when it's CSS-referenced (the parser can't see CSS url()s early). The hero box must never be empty — ship a poster/low-res placeholder so there's no blank frame.
  • Below the fold: loading="lazy" decoding="async" on images; preload="none" (or "metadata") on video; defer non-critical JS. Always reserve space (aspect-ratio, or width+height) so deferred media can't shift layout (CLS).
  • Keep the render-blocking head minimal: inline critical CSS, defer the rest.

Never let fonts pop in (no FOUT) — ever

font-display: swap is the pop — it paints a fallback face, then swaps to the webfont and reflows. Do not use it for any text the user watches load (titles, wordmarks, hero copy). The rule is absolute: title/display text must never flash a fallback or reflow.

  • Gate visibility on the real font. Synchronously in <head>, add a fonts-pending class to <html> that holds the display-font text at opacity: 0. On document.fonts.ready — kick it with document.fonts.load('<weight> 1em "Family"') for each critical face — swap to fonts-ready and fade the text in (0.5s). Always include a safety timeout (2.5s) that reveals regardless, so a font failure can never leave text permanently hidden.
  • Pair this with preload + WOFF2 (above) so the hidden window is a few hundred ms, not seconds — the fade reads as intentional, not as a stall.

…

常见问题

什么是“tokens”?

tokens 就像某个具体数值的名称或标签,比如一种精确的颜色或字号。使用 tokens 而不是直接写数值,能确保所有人用的是同一套视觉元素。

为什么正确加载字体很重要?

正确加载字体可以避免页面加载过程中文字“跳动”或外观突然变化,让用户体验更流畅。

这会对网站速度有什么影响?

通过优化图片和字体的加载方式,并统一使用一致的规则,网站可以加载得更快,看起来也更专业。

详情

作者的原始描述

Mechanical implementation invariants for frontend design: token architecture, typography hierarchy, loading order, FOUT prevention, chrome stability, motion timing, color semantics. Use with design when building components, pages, or design systems.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#6268
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能