Theme Styles
The theme-styles 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-styles 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-styles 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-styles pushCommands
Section titled “Commands”lps theme-styles pull
Section titled “lps theme-styles pull”Download the active theme’s Global Styles and write them as a .json file.
lps theme-styles pull [path]| Argument | Default | Description |
|---|---|---|
path |
./theme (or loopress.json’s themeStylesDir) |
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-styles push
Section titled “lps theme-styles push”Upload the local Global Styles file to WordPress.
lps theme-styles push [path]| Argument | Default | Description |
|---|---|---|
path |
./theme (or loopress.json’s themeStylesDir) |
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-styles pull first.
lps theme-styles diff
Section titled “lps theme-styles diff”Show what differs between the local Global Styles file and a WordPress environment.
lps theme-styles diff [path]This resource is also included automatically in the global lps diff.
File format
Section titled “File format”theme/ twentytwentyfour-global-styles.jsonEach 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.