跳到正文
Skillpedia
界面(UI/UX)56k · #3287

shade-use-primitives

它能做什么

这个技能告诉 AI 智能体使用 Shade 的布局组件,而不是手写布局类。适合构建界面、并希望间距和结构保持一致的开发者。

适用场景

  • ✓当你在基于 Shade 的应用中排列界面、区块或一行内容的时候。
  • ✓当你需要设置元素的间距、对齐、堆叠或换行的时候。
  • ✓当你想为普通包裹元素添加布局类的时候。

技能链接

https://github.com/TryGhost/Ghost/blob/main/apps/shade/skills/shade-use-primitives/SKILL.md

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“请帮我用 Shade 的布局组件排列设置页面中的表单字段,让它们间距均匀。”

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

工作原理

智能体会为每个包裹元素选择一个布局组件,例如垂直分组使用 Stack,一行内容使用 Inline。它会用 Shade 命名的间距档位设置间隙和内边距,只有属性无法覆盖的地方才使用类名。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Shade use primitives

Layout in Ghost UI reads by intent: Stack, Inline, Box, Grid, Container and Text replace hand-written flex and grid classes. The rules live in Primitives.

Docs links use https://shade.ghost.org. If the project's AGENTS.md says where Shade's docs are (another address, or a source folder), use that instead. Fetch web pages with curl -s.

Workflow

  1. Check for a larger shape first. A whole page starts from shade-page-templates; a recurring product shape may already be a pattern in Patterns.
  2. Pick the primitive for each wrapper with Use a primitive when.
  3. Set gaps and padding from the Spacing scale.
  4. Reserve className for what the props don't cover.

Self-check

  • No wrapper element in your diff carries only layout classes.
  • Spacing on primitives uses the named steps, and direction, gap, alignment and justification come from props.
  • Nothing in Don't applies to your diff.
常见问题

主要的布局组件有哪些?

该技能列出了 Stack、Inline、Box、Grid、Container 和 Text 作为基础组件。

我还需要写 flex 或 grid 类吗?

该技能说明,布局应当体现设计意图,因此这些基础组件可以替代大部分手写的 flex 和 grid 类。

整个页面有捷径吗?

有。整个页面从页面模板开始,重复出现的结构可能已经有现成的模式可用。

详情

作者的原始描述

Lay out Ghost UI with Shade's layout primitives. Use when laying out a screen, section or row, or when spacing, aligning, stacking or wrapping elements.

repo: TryGhost/Ghost

热度

GitHub 星标
56k
排名
#3287
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能