Install
openclaw skills install style-transfer提取目标网站的设计系统并应用到指定项目中(Vue/React/Next.js/Tailwind)。当用户说「把 XX 网站的样式应用到我的项目」或「用 Y 的风格重新设计」时使用。
openclaw skills install style-transfer将目标网站的设计风格迁移到指定项目中
npx designlang https://target-website.com/ --full
Or for faster extraction (no screenshots/interactions):
npx designlang https://target-website.com/
Output goes to ~/.designlang/{domain}.json and ~/.hermes-agent/workspace/design-extract-output/.
Inspect the project at the target path:
# Detect framework
ls /path/to/project/src/ # Vue/React
ls /path/to/project/ # Next.js (app/, pages/)
cat /path/to/project/package.json | grep -E "vue|react|next"
# Detect styling approach
ls /path/to/project/src/assets/styles/ # SCSS/CSS variables
cat /path/to/project/tailwind.config.js # Tailwind
cat /path/to/project/src/style.css # Plain CSS
cat /path/to/project/src/App.vue # Vue SFC styles
Key files to read from ~/.hermes-agent/workspace/design-extract-output/:
| File | Purpose |
|---|---|
*-design-tokens.json | DTCG format tokens (primitive + semantic) |
*-tailwind.config.js | Tailwind theme config |
*-shadcn-theme.css | shadcn/ui CSS variables |
*-global.css / *-variables.css | CSS custom properties |
*-design-language.md | Full design doc (colors, fonts, spacing) |
*-gradients.css | Brand gradients |
*-motion-tokens.json | Animation tokens |
global.scss / main CSS — replace CSS variables:
// src/assets/styles/global.scss
// Replace :root variables with extracted tokens
:root {
--primary-color: #7f41ff; // from design-tokens.json
--bg-color: #fdfcff;
--text-primary: #261c3a;
--border-color: #d9bfe2;
--radius: 16px;
--shadow: 0 0 24px rgba(0,0,0,0.03);
--gradient-brand: linear-gradient(90deg, #7f41ff, #ab8ee8);
}
Add Google Fonts to index.html:
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
Component styles — update <style> blocks:
background with --gradient-brandborder-radius values with --radius--shadowborder-radius: 999px)Tailwind config — merge extracted tokens:
// tailwind.config.js
colors: {
primary: '#7f41ff',
secondary: '#ab8ee8',
accent: '#d9bfe2',
}
globals.css:
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
:root {
--primary: #7f41ff;
--background: #fdfcff;
}
}
Inject the *-variables.css content into <style> tag and add Google Fonts link.
cd /path/to/project
npm run build
# or
npm run dev
Check dist output for:
--full flag, timeout after 120ssrc/assets/styles/global.scss and import in main.js / main.tsx<head>, check networkcontent[] paths:root or global.scss leak into scoped styles correctly# Check CSS variables applied
grep -o "#[0-9a-fA-F]\{6\}" dist/assets/*.css | sort | uniq
# Check gradient applied
grep -c "gradient" dist/assets/*.css
# Check font loaded
grep "fonts.googleapis" dist/index.html
If user says "my project" without specifying path:
package.json../ for project with src/ directoryUser: "把 withlantern.com 的样式应用到我的 Vue 项目里"
npx designlang https://withlantern.com/ → extract design*-design-tokens.json → get color palette*-global.css → get CSS variablessrc/assets/styles/global.scss → apply new variablesindex.htmlnpm run build → verify