Theme Styles
The theme style command group lets you version-control the Global Styles customizations you make in the WordPress Site Editor’s Styles screen: colors, typography, and spacing. WordPress stores these in a wp_global_styles post, one per theme, separate from the theme’s own theme.json file (which lives in the theme’s own repository and is not what this feature syncs).
Global Styles are a block theme (Full Site Editing) feature. theme style commands fail with a clear error if the site’s active theme is a classic theme.
Only the currently active theme’s Global Styles are synced. Switching the active theme on WordPress and pulling again writes a new file for the newly active theme, it never deletes the previous one.
Typical workflow
Section titled “Typical workflow”# 1. Download the active theme's Global Styles from WordPresslps theme style pull
# 2. Edit locally, commit to Gitgit add theme/ && git commit -m "feat: update brand colors in Global Styles"
# 3. Deploy back to WordPresslps theme style pushCommands
Section titled “Commands”Every command below also accepts the common flags: --env, --json, and --yes where it applies.
lps theme style pull
Section titled “lps theme style pull”Download the active theme’s Global Styles and write them as a .json file.
lps theme style pull [path]| Argument | Default | Description |
|---|---|---|
path |
./theme (or loopress.json’s themeStyleDir) |
Local directory where the Global Styles file is written |
| Flag | Description |
|---|---|
--dry-run / -d |
Show what would be written without touching the filesystem |
lps theme style push
Section titled “lps theme style push”Upload the local Global Styles file to WordPress.
lps theme style push [path]| Argument | Default | Description |
|---|---|---|
path |
./theme (or loopress.json’s themeStyleDir) |
Local directory to read the Global Styles file from |
| Flag | Description |
|---|---|
--dry-run / -d |
Show what would be pushed without making any changes |
Push fails clearly if no local file exists for the active theme, run lps theme style pull first.
lps theme style diff
Section titled “lps theme style diff”Show what differs between the local Global Styles file and a WordPress environment, or between two environments with --against. Also part of the aggregate lps diff (--only theme-styles).
lps theme style diff [path]lps theme style diff --env staging --against productionExits 0 in sync, 1 on drift, 2 when the comparison failed.
lps theme style rollback
Section titled “lps theme style rollback”Restore the active theme’s Global Styles on WordPress to the snapshot saved automatically before an earlier lps theme style push. See Rollback and Snapshots.
lps theme style rollback # the most recent snapshotlps theme style rollback --list # available snapshotslps theme style rollback --to <id> # an older oneFile format
Section titled “File format”theme/ twentytwentyfour-global-styles.json templates/ # block templates, see Templates and parts parts/ # template partsEach file is named <stylesheet-slug>-global-styles.json and holds { "settings", "styles" }, the same shape as the settings/styles keys of a theme’s theme.json. WordPress bookkeeping fields (the post id, _links) are never part of the tracked file.