Design & UX · Building & coding
grid-design
/grid-design
yiui.dev 的线条网格设计规范。在本项目里做任何页面、区块、页面布局时使用:竖线容器、全屏横线、点阵分隔带与交点十字、虚线分栏、章节编号栏、配色与排版规则。
For whom
Assessment and security
100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
Deprecation
No signals detected. Repository changed on 11.11.2026, without references to retired models or APIs.
Licence
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
yiui.dev 的线条网格设计规范。在本项目里做任何页面、区块、页面布局时使用:竖线容器、全屏横线、点阵分隔带与交点十字、虚线分栏、章节编号栏、配色与排版规则。
Original author description
yiui.dev 的线条网格设计规范。在本项目里做任何页面、区块、页面布局时使用:竖线容器、全屏横线、点阵分隔带与交点十字、虚线分栏、章节编号栏、配色与排版规则。
How it works
- 结构模型
- 规则
- 自查清单
Original SKILL.md headings · 58 lines, 196 words
SKILL.md preview
---
name: grid-design
description: yiui.dev 的线条网格设计规范。在本项目里做任何页面、区块、页面布局时使用:竖线容器、全屏横线、点阵分隔带与交点十字、虚线分栏、章节编号栏、配色与排版规则。
metadata:
internal: true
---
# 线条网格设计规范
## 结构模型
整页只有**一个** `GridContainer`(固定宽度 + 左右竖线),所有内容按"行"自上而下堆叠:
```tsx
import {
GridColumns,
GridContainer,
GridSection,
GridSeparator,
} from "@/registry/ui/grid-layout/grid-layout"
<GridContainer>
<GridSection className="px-4 py-6">…</GridSection> {/* 底部全屏横线 */}
<GridSeparator /> {/* 点阵分隔带 */}
<GridSection>
<GridColumns> {/* 虚线分栏 */}
<div className="p-4">…</div>
<div className="p-4">…</div>
</GridColumns>
</GridSection>
</GridContainer>
```
底层工具类(`src/styles/grid.css`):
- `screen-line-top` / `screen-line-bottom`:横跨整个屏幕的 1px 线(分别占用 `::before` / `::after`,不要在同一元素上再用这两个伪元素)
- 分隔带纹理:`pattern-ruler`、`pattern-hatch`、`pattern-dots`、`pattern-grid`、`pattern-plus`、`pattern-wave`——31px 高的 mask 平铺,**只供 GridSeparator 内部使用**,页面里通过 `<GridSeparator pattern="…">` 选择
- 面积底纹:`bg-hatch`(「\」斜纹)、`bg-dots`(点阵)——普通背景图,可铺在任意元素上(横幅、卡片背景),元素内可放文字
- 像素约定:纹理平铺原点固定在容器左竖线上,周期 8/16/32/128 整除容器宽度;GridContainer 外宽 = --grid-width + 1px
- 颜色 token:`border-edge` / `bg-edge` / `divide-edge`(`--edge` 由前景色混合得到,自动适配所有颜色主题)
## 规则
1. **只画底线**:相邻两行只由上一行的 `screen-line-bottom` 分隔,不要上下都画,否则会出现 2px 线。页面第一行(紧接 Header)由 Header 自带底线。
2. 行与行之间要换主题时(如个人信息 → 作品),用 `GridSeparator`;同一主题内部用普通 `GridSection`。
- **默认是 `dots`(点阵)**,页面里的主分隔一律用它,不要每处换一种纹路;`ruler` 刻度尺可用于需要「度量感」的局部
- 其余纹路是变体:`hatch`(斜纹)、`dots`、`grid`、`plus`、`wave`、`none`(只留线条),用于局部强调或区分特殊区域(如文档预览、某一块实验性内容),一页里最多再出现一种。
- `label="02 / PROJECTS"` 给分隔带加等宽编号,后接虚线,可与任意纹路组合;用于大段落切换,不要每条都加。
- `crosshair` 默认关闭;`GridSection` 也可传 `crosshair` 在底线两端绘制。十字也可用 `GridCrosshair` 单独放在带 `relative` 的卡片四角。
3. 行内边距统一 `px-4`(≥sm 时 `sm:px-6` 可选),不要让内容贴到竖线上。
4. 容器外的左右空白(gutter)尽量保持干净;确需放装饰元素时,必须 `hidden lg:block`、`aria-hidden`、`pointer-events-none`,用绝对定位相对于 `GridSection` 向外偏移。不要把手写体 follow me 之类的装饰当作默认。
5. 页面宽度:全站统一 80rem,由 `SiteShell`(`src/components/site/site-shell.tsx`)设置一次 `--grid-width`,页面不要自己覆盖;正文类内容(文章)自己限制到约 42rem 并居中(文章页是「元信息 / 正文 / 目录」三栏);章节可以用「左侧窄编号栏 + 右侧内容」的两栏结构(宽屏 `md:grid-cols-[9rem_1fr]`,窄屏编号移到标题上方),编号栏用竖线与内容隔开。
6. 线条一律用 `edge` 颜色,不要用 `border-border`(太重)或任何硬编码颜色。
7. 等宽字体(`font-mono`)用于元信息:时间、邮箱、电话、坐标、标签;正文和标题用 `font-sans`。
8. 图标容器:`size-8 rounded-md border border-edge bg-muted/50` 之类的小方块。
9. 克制配色:默认黑白灰,强调色只来自 `primary`;颜色主题切换后整站应自然变化。
10. 动效用 `motion`,时长 150–300ms,尊重 `prefers-reduced-motion`。
11. 中文排版:正文 `leading-7`,标题 `tracking-tight`;中英文之间留空格。
## 自查清单
- [ ] 改变颜色主题、切换亮暗模式后线条都可见且不刺眼
- [ ] 375px 宽度下无横向滚动条,分栏正确堆叠
- [ ] 没有出现双线、断线;交点十字落在竖线与横线的正中
- [ ] 页面主分隔用默认 dots,其他纹路只在局部使用
Versions
The database has no other skills named grid-design.
Database snapshot: 13.11.2026 · package version b1b9a59c2093 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100yi-ui
在使用者自己的项目里选择、安装、组合 Yi UI(yiui.dev,@yiui)的组件、区块和页面。用户提到 Yi UI、@yiui、方条控件、线条网格、网格工具栏、中文表单控件(金额、手机号、证件号、省市区)时使用;项目已装 components/ui/ 下带子目录的 Yi UI 组件时也使用。不用于维护 Yi UI 仓库本身。 - 90grid
When the user wants to design, optimize, or audit grid layouts for content display. Also use when the user mentions "grid layout," "grid design," "multi-column grid," "CSS grid," "responsive grid," "card grid," "product grid," or "feature grid." For cards layout, use card. - 90grid-layout
Design a layout system — spacing scale, grid columns, and layout primitives. Use when asked to "design a spacing system", "set up a layout grid", or "build layout primitives". - 90card
When the user wants to design, optimize, or audit card layouts for content display. Also use when the user mentions "card layout," "card component," "card grid," "product cards," "template cards," "tool cards," "feature cards," "gallery cards," "integration cards," or "card… - 96image-grid-split
自动识别宫格分割线,将单张多格图拆分为多张独立图片。当用户说四宫格拆分、九宫格拆开、切成四张、2x2/3x3 切图、宫格图分开、拼图拆分、格子图拆开 时触发。 - 95evidence-ui
Use when laying out or polishing Evidence.dev pages — Accordion, Alert, Grid, Tabs, Modal, Note, Details, DownloadData, Embed, Image, Link, LinkButton, BigLink, Info, LastRefreshed and PrintFormat.