A native macOS app for browsing, searching, and copying the CSS custom properties that WordPress generates from a theme's theme.json file.
Point it at a folder containing one or more WordPress installations and it scans for every wp-content/themes/*/theme.json, parses the settings, reconstructs the CSS variables WordPress would output, and presents them in a clean two-column table — with live pixel annotations for every value.
- macOS 14 (Sonoma) or later
- Xcode 15 or later (to build from source)
- Unzip the project folder.
- Open
ThemeJsonViewer.xcodeprojin Xcode. - Select your Mac as the run destination.
- Press ⌘R.
No dependencies, no Swift Package Manager, no CocoaPods. The entire app is five Swift files.
On first launch the sidebar shows an Open Directory… button. Click it (or press ⌘O, or go to Settings → Directory → Open…) and choose:
- a single WordPress site root (the folder that contains
wp-content/), or - a parent folder that holds multiple WordPress sites side by side.
The app recursively scans the chosen folder, skipping node_modules, vendor, .git, dist, build, and other non-source directories. Themes appear in the sidebar as they are found — you do not need to wait for the scan to complete before clicking one.
Themes are grouped into collapsible sections by project name. Each row shows the theme's human-readable name (from style.css) with the directory slug underneath in monospace, and a variable count on the right.
Use the search field at the top of the sidebar to filter across theme name, directory slug, and project name simultaneously.
The main table has two columns:
| Variable | Value |
|---|---|
--wp--preset--color--primary |
#3a86ff |
--wp--preset--font-size--lg |
clamp(1.125rem, …, 1.5rem) |
Click any cell — name or value — to copy it to the clipboard. A brief highlight and "Copied!" indicator confirm the action. The click target is a full-height row, not just the text.
Every value in the right column receives an automatic grey annotation where possible:
| Value type | Annotation shown |
|---|---|
1.5rem |
= 24px |
clamp(0.875rem, …, 1.5rem) |
≈ 14px – 24px |
var(--wp--preset--color--base) |
→ #ffffff (resolved from the theme's own variables) |
calc(1rem + 4px) |
≈ 20px |
The clamp() annotation extracts the first and last arguments and converts them to pixels, giving you the minimum and maximum rendered size at a glance without needing to read the fluid formula.
A dropdown next to the search field filters variables by type:
- 🎨 Color
- 🌈 Gradient
- ◑ Duotone
- 🔤 Font Size
- 🔠 Font Family
- 📐 Spacing
- 🌑 Shadow
- ⬜ Border
- 📏 Dimension
- ✨ Custom
In the top-right corner of the variables view is a small Base px field, defaulting to 16. Change this per theme if its root font size is not the browser default — all rem and em annotations update instantly. The value is remembered per theme for the session.
Switch to Raw JSON to see the exact contents of theme.json as loaded from disk — useful for debugging why a theme shows fewer variables than expected. A Copy JSON button copies the entire file to the clipboard.
If the file declares a $schema URL, a clickable link appears in the tab bar so you can open the schema in a browser.
The app mirrors WordPress's own CSS variable generation logic from theme.json settings:
| JSON path | CSS property prefix |
|---|---|
settings.color.palette |
--wp--preset--color-- |
settings.color.gradients |
--wp--preset--gradient-- |
settings.color.duotone |
--wp--preset--duotone-- |
settings.typography.fontSizes |
--wp--preset--font-size-- |
settings.typography.fontFamilies |
--wp--preset--font-family-- |
settings.spacing.spacingSizes |
--wp--preset--spacing-- |
settings.spacing.spacingScale |
--wp--preset--spacing-- (auto-generated scale) |
settings.border.radiusSizes |
--wp--preset--border-radius-- |
settings.shadow.presets |
--wp--preset--shadow-- |
settings.dimensions.dimensionSizes |
--wp--preset--dimension-- |
settings.custom (any depth) |
--wp--custom-- (recursively flattened) |
Font sizes that use WordPress's fluid typography system are resolved to their clamp() output using the same algorithm as wp_get_typography_font_size_value():
- Per-size
fluid: { min, max }— uses the explicit bounds. - Per-size
fluid: trueorfluidomitted, with globalsettings.typography.fluid: true— auto-calculates a 75% scale factor minimum. - Per-size
fluid: false— skipped; the staticsizevalue is used.
The minimum and maximum viewport widths and the minimum font size limit are taken from settings.typography.fluid when present, falling back to WordPress defaults (320 px / 1000 px / 14 px).
Open Settings (⚙ gear icon in the sidebar toolbar).
Shows the currently scanned path. Click Open… to choose a different folder.
Use human-readable theme name — when enabled (the default), the sidebar and detail header show the Theme Name: value from style.css rather than the directory slug. The slug is shown in small monospace text below the name when the two differ.
When the app works out what to call a "project" in the sidebar section header, it walks up the directory tree from /wp-content/ looking for a meaningful folder name. Folders in this list are skipped — the first ancestor not on the list becomes the project name.
This solves the common local development structure where the actual site name lives above generic wrapper folders:
Sites/
mysite.test/
app/ ← skipped
public/ ← skipped
wp-content/
Here mysite.test would be used as the project name because app and public are in the skip list.
Default skip list: public, app, www, htdocs, html, web, webroot
You can add your own entries, remove defaults, and drag to reorder (order does not affect the walk-up logic — any matching folder is skipped regardless of list position). Reset to defaults restores the original list.
ThemeJsonViewer/
├── ThemeJsonViewerApp.swift Entry point, menu commands
├── AppState.swift Observable state, directory scanning, site parsing
├── WordPressCSSGenerator.swift theme.json models + CSS variable generation
├── ContentView.swift Sidebar, detail tabs, settings sheet
├── ThemeVariablesView.swift Variable table, ValueAnnotator, CopyableCell
└── Assets.xcassets/ App icon
-
Inherited variables — WordPress child themes and block themes can inherit variables from parent themes or from WordPress core itself. This app only reads the
theme.jsonin each theme folder; it does not merge parent or core defaults. If a theme has very few variables it likely relies heavily on inheritance from a parent theme or from core's built-in presets. The Raw JSON tab helps confirm what the file actually contains. -
var()resolution — cross-variable references are resolved one level deep using the theme's own variable map. References to variables defined in a parent theme or in WordPress core will show asunresolved. -
vwunits inclamp()— the middle argument of most fluid font-size clamp values is avw-based expression. The annotation shows only the clamped minimum and maximum (the first and last arguments), not the viewport-relative preferred value, since that cannot be computed without knowing the viewport width. -
No live reload — changes to
theme.jsonfiles on disk are not detected while the app is running. Re-open the directory to rescan.
MIT. Do whatever you like with it.