← Back to Skills Marketplace
babywhale

Style Transfer(风格迁移)

by manniu · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
33
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install style-transfer
Description
提取目标网站的设计系统并应用到指定项目中(Vue/React/Next.js/Tailwind)。当用户说「把 XX 网站的样式应用到我的项目」或「用 Y 的风格重新设计」时使用。
README (SKILL.md)

style-transfer(风格迁移)

将目标网站的设计风格迁移到指定项目中

Workflow

Step 1 — Extract design from target website

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/.

Step 2 — Detect project type

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

Step 3 — Read extracted design files

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

Step 4 — Apply styles based on project type

Vue 3 + Vite project

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:

\x3Clink href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet" />

Component styles — update \x3Cstyle> blocks:

  • Replace button background with --gradient-brand
  • Replace border-radius values with --radius
  • Replace shadows with --shadow
  • Update tag styles to pill shape (border-radius: 999px)

Next.js / React project

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;
  }
}

Plain HTML / Static site

Inject the *-variables.css content into \x3Cstyle> tag and add Google Fonts link.

Step 5 — Build and verify

cd /path/to/project
npm run build
# or
npm run dev

Check dist output for:

  • CSS contains new color tokens (grep for primary hex)
  • No build errors
  • Font loaded correctly

Common Pitfalls

  1. npx designlang hangs — use without --full flag, timeout after 120s
  2. Project has no src/styles — create src/assets/styles/global.scss and import in main.js / main.tsx
  3. CSS variable conflicts — ensure new variables override old ones; check specificity
  4. Font not loading — verify Google Fonts URL in \x3Chead>, check network
  5. Tailwind purge removes new classes — ensure design tokens are in content[] paths
  6. Vue scoped styles — CSS vars defined in :root or global.scss leak into scoped styles correctly

Verification Commands

# 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

Project Path Resolution

If user says "my project" without specifying path:

  • Check current working directory for package.json
  • Check ../ for project with src/ directory
  • Ask user for explicit path if ambiguous

Example Conversation

User: "把 withlantern.com 的样式应用到我的 Vue 项目里"

  1. npx designlang https://withlantern.com/ → extract design
  2. Read *-design-tokens.json → get color palette
  3. Read *-global.css → get CSS variables
  4. Read project's src/assets/styles/global.scss → apply new variables
  5. Add Google Fonts to index.html
  6. Update component button styles to use gradient
  7. npm run build → verify
Usage Guidance
Before installing, use it only on a project you are comfortable modifying, confirm the exact project path, expect network access through `npx designlang` and Google Fonts, and review the resulting diff before committing changes.
Capability Assessment
Purpose & Capability
The stated purpose is to extract a target website's design system and apply it to Vue, React, Next.js, Tailwind, or static projects; the instructed file edits, design-token reads, font link insertion, and build checks fit that purpose.
Instruction Scope
The skill directs broad style changes to project files and may infer a project path from the current or parent directory, but it also says to ask when the path is ambiguous and does not request unrelated authority.
Install Mechanism
There is no packaged executable or install script in the artifact, but runtime use of `npx designlang` and Google Fonts involves external network/package access that users should understand.
Credentials
Reading project files, writing style changes, and running `npm run build` or `npm run dev` are proportionate for a frontend style migration, though they can affect the user's working tree.
Persistence & Privilege
No elevated privileges, background workers, credential access, autostart, or durable persistence are requested; the only persistent outputs described are design extraction files under user home directories and normal project edits.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install style-transfer
  3. After installation, invoke the skill by name or use /style-transfer
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of style-transfer — extract and apply design systems from websites to Vue/React/Next.js/Tailwind projects. - Added workflow for extracting design tokens and system from any website using `npx designlang`. - Guides for detecting project frameworks and styling methods. - Instructions for mapping extracted tokens (colors, gradients, CSS vars, Tailwind config) into various frontend project types. - Common troubleshooting tips for build and style integration. - Verification steps to confirm styles are correctly applied. - Example conversation for converting a website design onto a user's project.
Metadata
Slug style-transfer
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Style Transfer(风格迁移)?

提取目标网站的设计系统并应用到指定项目中(Vue/React/Next.js/Tailwind)。当用户说「把 XX 网站的样式应用到我的项目」或「用 Y 的风格重新设计」时使用。 It is an AI Agent Skill for Claude Code / OpenClaw, with 33 downloads so far.

How do I install Style Transfer(风格迁移)?

Run "/install style-transfer" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Style Transfer(风格迁移) free?

Yes, Style Transfer(风格迁移) is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Style Transfer(风格迁移) support?

Style Transfer(风格迁移) is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Style Transfer(风格迁移)?

It is built and maintained by manniu (@babywhale); the current version is v1.0.0.

💬 Comments