使用 .cursor/rules 强制执行设计系统
Cursor Team · Cursor Docs ·
编写 design-system.mdc 规则文件来固定间距标度、颜色令牌、圆角和排版,确保 Cursor 生成的每个组件都符合品牌标准——包含作用域规则和 glob 定位的示例。
发布者摘要
Write a design-system.mdc rule that pins spacing scale, color tokens, radius and typography so every component Cursor generates stays on-brand. Covers scoped rules and glob targeting.
文章结构
- Anatomy of a design-system rule
- Pinning tokens: color, spacing, radius
- Scoping rules with globs
- Always-on vs auto-attached
- Testing the rule on a new component
Source: Cursor Docs
阅读原文 ↗ 内容托管在原发布者的网站上。
由 Cursor-Design 社区精选,作为用 Cursor 做设计的一手参考。