design-to-code-local

本地版设计稿还原工具。Implements UI from design mockups (Figma, Sketch, or image) with pixel-accurate layout, responsive behavior, and design tokens. Use when 还原设计图, implementing designs, 切图, 设计稿转代码, or converting mockups to frontend code.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "design-to-code-local" with this command: npx skills add longfer/design-to-code-local

还原设计图(Design to Code)

将设计稿(Figma/Sketch/图片)高保真还原为前端代码,保证布局、间距、字体、颜色与交互一致。

触发场景

  • 用户说「还原设计图」「按设计稿实现」「切图」「设计转代码」
  • 提供 Figma/Sketch 链接、设计图截图或标注
  • 需要实现某个页面/组件的 UI

执行流程

1. 解析设计稿

  • 标注:尺寸、间距(padding/margin/gap)、字号与行高、颜色(含透明度)、圆角、阴影、边框
  • 层级:组件划分、嵌套关系、可复用模块
  • 状态:默认 / hover / focus / disabled / 加载 / 空态 / 错误
  • 响应式:断点、不同宽度下的布局变化(栅格、换行、隐藏)

2. 设计 token 对齐

  • 颜色、字号、间距尽量映射到项目已有 CSS 变量或 Tailwind 配置
  • 若无现成 token,在实现时用变量命名(如 --color-primary),便于后续统一

3. 实现优先级

  1. 布局:Flex/Grid 先搭骨架,保证对齐与间距
  2. 字体排版:字体、字号、字重、行高、颜色
  3. 视觉:背景、边框、圆角、阴影
  4. 交互状态:hover/focus/disabled 等
  5. 响应式:断点与弹性布局
  6. 动效:若有设计说明的过渡/动画再补

4. 还原度自检

  • 关键尺寸与设计稿一致(可容忍 1–2px 差异)
  • 字体与颜色与设计一致
  • 主要断点下布局合理、无错位
  • 可交互元素有明确状态反馈

输出约定

  • 使用项目现有技术栈(如 Next.js、Tailwind、SCSS、组件库)
  • 组件化:可复用部分拆成组件并命名清晰
  • 语义化 HTML + 合理 ARIA(按钮、链接、表单)
  • 必要时注明:某处与设计稿差异及原因(如兼容性、可访问性)

常用对照

设计稿实现方式
8px 栅格间距用 8 的倍数(8/16/24/32)
字体层级对应 heading/body/caption 等语义类或 design token
模糊/毛玻璃backdrop-filter + 半透明背景
多行截断line-clamp 或 -webkit-line-clamp
安全区域padding 配合 env(safe-area-inset-*)

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Huo15 Openclaw Enhance

火一五·克劳德·龙虾增强插件 v5.7.8 — 全面适配 openclaw 2026.4.24:peerDep ^4.24 + build/compat 同步到 4.24 + 14 处 api.on 全部去掉 as any 改成 typed hook(hookName 联合类型 + handler 自动推断 Pl...

Registry SourceRecently Updated
General

Content Trend Analyzer

Aggregates and analyzes content trends across platforms to identify hot topics, user intent, content gaps, and generates data-driven article outlines.

Registry SourceRecently Updated
General

Prompt Debugger

Debug prompts that produce unexpected AI outputs — diagnose failure modes, identify ambiguity and conflicting instructions, test variations, compare model re...

Registry SourceRecently Updated
General

Indie Maker News

独行者 Daily - 变现雷达。读对一条新闻,少走一年弯路。每天5分钟,给创业者装上商业雷达。聚焦一人公司、副业、创业变现资讯,智能分类,行动导向。用户下载即能用,无需本地部署!

Registry SourceRecently Updated