convert-to-wp-theme
Convert a complete HTML/CSS/JavaScript project into a production-ready WordPress block theme (Full Site Editing).
Generate a WordPress block theme style variation (styles/*.json) — dark mode, color palette swap, or font swap.
> /plugin marketplace add siddik-web/wp-block-theme-converter > /plugin install wp-block-theme-converter@siddik-web
How it fires
How this command gets triggered: by you, by Claude, or both.
/wp-variationContext preview
What this command does when you run it.
Generate a WordPress block theme style variation (styles/*.json) — dark mode, color palette swap, or font swap.
description: Generate a WordPress block theme style variation (styles/*.json) — dark mode, color palette swap, or font swap.
**Purpose:** Generate a WordPress block theme style variation — a `styles/*.json` file that overrides color, typography, and spacing from the base `theme.json` to create an alternative theme aesthetic.
Trigger this command when:
**Do not** use this command for per-page or per-block style changes — style variations apply globally to the entire site.
Ask (or infer from context):
| Question | Default if silent | |----------|-------------------| | Variation name (human-readable) | Required — always ask | | Variation slug (kebab-case file name) | Derived from name | | What to change: colors, typography, spacing, or all three? | Colors only (most common) | | Color palette overrides | Required if colors are changing | | Font overrides | Optional — only if changing fonts | | Spacing overrides | Optional — only if changing scale | | Is this a **global variation** (appears in Site Editor) or a **scoped variation** (Section Style on a Group block)? | Global variation |
**Global vs Scoped Variations:**
| | Global Style Variation | Section Style | |-|----------------------|---------------| | Applies to | Entire site | A single block instance | | File location | `styles/{{slug}}.json` | `styles.blocks.core/group.variations.{{slug}}` in theme.json | | Appears in | Site Editor → Styles → Browse styles | Block toolbar → Styles | | WordPress version | 6.0+ | 6.6+ |
If the user wants a variation for a single block (e.g., a "dark section" Group block), refer to `references/modern-blocks.md` — Section Styles section instead.
VARIATION PLAN: {{Variation Name}}
File: styles/{{slug}}.json
Changes:
Colors: {{list color palette changes}}
Typography: {{list font changes, or "no changes"}}
Spacing: {{list spacing changes, or "no changes"}}
Elements: {{list element style changes}}Style variations are **partial `theme.json` files** — they override only the keys they define. The rest inherits from the base `theme.json`.
**Minimum valid structure:**
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 3,
"title": "{{Variation Name}}",
"slug": "{{variation-slug}}",
"settings": {},
"styles": {}
}**Color-only variation (most common):**
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 3,
"title": "{{Variation Name}}",
"slug": "{{variation-slug}}",
"settings": {
"color": {
"palette": [
{
"slug": "primary",
"color": "{{new-primary-color}}",
"name": "Primary"
},
{
"slug": "secondary",
"color": "{{new-secondary-color}}",
"name": "Secondary"
},
{
"slug": "foreground",
"color": "{{new-foreground-color}}",
"name": "Foreground"
},
{
"slug": "background",
"color": "{{new-background-color}}",
"name": "Background"
},
{
"slug": "surface",
"color": "{{new-surface-color}}",
"name": "Surface"
}
]
}
},
"styles": {
"color": {
"background": "var(--wp--preset--color--background)",
"text": "var(--wp--preset--color--foreground)"
},
"elements": {
"link": {
"color": {
"text": "var(--wp--preset--color--primary)"
},
":hover": {
"color": {
"text": "var(--wp--preset--color--secondary)"
}
}
},
"button": {
"color": {
"background": "var(--wp--preset--color--primary)",
"text": "var(--wp--preset--color--background)"
},
":hover": {
"color": {
"background": "var(--wp--preset--color--secondary)",
"text": "var(--wp--preset--color--background)"
}
}
},
"h1": { "color": { "text": "var(--wp--preset--color--foreground)" } },
"h2": { "color": { "text": "var(--wp--preset--color--foreground)" } },
"h3": { "color": { "text": "var(--wp--preset--color--foreground)" } }
}
}
}**Dark mode variation:**
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 3,
"title": "Dark",
"slug": "dark",
"settings": {
"color": {
"palette": [
{ "slug": "background", "color": "#0F172A", "name": "Background" },
{ "slug": "surface", "color": "#1E293B", "name": "Surface" },
{ "slug": "foreground", "color": "#F1F5F9", "name": "Foreground" },
{ "slug": "muted", "color": "#94A3B8", "name": "Muted" },
{ "slug": "border", "color": "#334155", "name": "Border" },
{ "slug": "primary", "color": "#6366F1", "name": "Primary" },
{ "slug": "secondary", "color": "#8B5CF6", "name": "Secondary" }
]
}
},
"styles": {A Claude Code plugin (and standalone skill) for converting any HTML/CSS/JavaScript project into a production-ready WordPress Block Theme (Full Site Editing). Author: Md Siddiqur Rahman License: MIT
Repo: siddik-web/wp-block-theme-converter
Convert a complete HTML/CSS/JavaScript project into a production-ready WordPress block theme (Full Site Editing).
Generate an empty, valid WordPress block theme scaffold from scratch — no source HTML required.
Scaffold a custom WordPress block (block.json, edit.js, save.js or render.php, styles) ready to register inside a block theme.
Convert an existing classic WordPress theme (PHP templates, functions.php) into a Full Site Editing block theme.
Diagnose and fix WordPress block-theme failures — block validation errors, theme.json issues, missing patterns, DB template overrides, and PHP warnings.
Migrate existing WordPress content (Classic Editor, ACF, widgets, CPTs, shortcodes, page builders) into a block theme.