extract-design
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseExtract Design Language
提取设计语言
Extract the complete design language from any website URL. Generates 8 output files covering colors, typography, spacing, shadows, components, breakpoints, animations, and accessibility.
从任意网站URL提取完整的设计语言。生成8种输出文件,涵盖颜色、排版、间距、阴影、组件、断点、动画和可访问性相关内容。
Prerequisites
前置条件
Ensure is available. Install if needed:
designlangbash
npm install -g designlangOr use npx (no install required):
bash
npx designlang <url>确保可用。如有需要请安装:
designlangbash
npm install -g designlang或使用npx(无需安装):
bash
npx designlang <url>Process
操作流程
- Run the extraction on the provided URL:
bash
npx designlang <url> --screenshotsFor multi-page crawling:
For dark mode:
npx designlang <url> --depth 3 --screenshotsnpx designlang <url> --dark --screenshots- Read the generated markdown file to understand the design:
bash
cat design-extract-output/*-design-language.md-
Present key findings to the user:
- Primary color palette with hex codes
- Font families in use
- Spacing system (base unit if detected)
- WCAG accessibility score
- Component patterns found
- Notable design decisions (shadows, radii, etc.)
-
Offer next steps:
- Copy into their project
*-tailwind.config.js - Import into their stylesheet
*-variables.css - Paste into globals.css for shadcn/ui users
*-shadcn-theme.css - Import for React/CSS-in-JS projects
*-theme.js - Import into Figma for designer handoff
*-figma-variables.json - Open in a browser for a visual overview
*-preview.html - Use the markdown file as context for AI-assisted development
- Copy
- 执行提取操作:针对提供的URL运行提取:
bash
npx designlang <url> --screenshots如需多页面爬取:
如需提取深色模式:
npx designlang <url> --depth 3 --screenshotsnpx designlang <url> --dark --screenshots- 查看生成的markdown文件以了解设计细节:
bash
cat design-extract-output/*-design-language.md-
向用户展示关键发现:
- 带有十六进制代码的主色调色板
- 使用的字体族
- 间距系统(如检测到基础单位)
- WCAG可访问性评分
- 发现的组件模式
- 值得关注的设计决策(阴影、圆角等)
-
提供后续操作建议:
- 将复制到项目中
*-tailwind.config.js - 将导入样式表
*-variables.css - 对于shadcn/ui用户,将粘贴到globals.css中
*-shadcn-theme.css - 为React/CSS-in-JS项目导入
*-theme.js - 将导入Figma以实现设计师交接
*-figma-variables.json - 在浏览器中打开查看可视化概览
*-preview.html - 将markdown文件作为AI辅助开发的上下文
- 将
Output Files (8)
输出文件(共8种)
| File | Purpose |
|---|---|
| AI-optimized markdown — the full design system for LLMs |
| Visual HTML report with swatches, type scale, shadows, a11y |
| W3C Design Tokens format |
| Ready-to-use Tailwind CSS theme |
| CSS custom properties |
| Figma Variables import format |
| React/CSS-in-JS theme object |
| shadcn/ui theme CSS variables |
| 文件 | 用途 |
|---|---|
| AI优化的markdown — 面向大语言模型的完整设计系统 |
| 可视化HTML报告,包含色板、字体层级、阴影、可访问性信息 |
| W3C设计令牌格式 |
| 可直接使用的Tailwind CSS主题 |
| CSS自定义属性 |
| Figma变量导入格式 |
| React/CSS-in-JS主题对象 |
| shadcn/ui主题CSS变量 |
Additional Commands
附加命令
- Compare two sites:
npx designlang diff <urlA> <urlB> - View history:
npx designlang history <url>
- 对比两个网站:
npx designlang diff <urlA> <urlB> - 查看历史记录:
npx designlang history <url>
Options
参数选项
| Flag | Description |
|---|---|
| Output directory (default: |
| Also extract dark mode color scheme |
| Crawl N internal pages for site-wide extraction |
| Capture component screenshots (buttons, cards, nav) |
| Wait time after page load for SPAs |
| Generate only specific theme ( |
| 参数 | 说明 |
|---|---|
| 输出目录(默认值: |
| 同时提取深色模式配色方案 |
| 爬取N个内部页面以实现全站提取 |
| 捕获组件截图(按钮、卡片、导航等) |
| 页面加载后的等待时间(适用于单页应用) |
| 仅生成特定主题( |