WP Manifestindependent plugin directory
manifest / themes / enable-global-styles

Enable Global Styles

Enables the full Global Styles editor in the Site Editor for classic and hybrid themes.

by blocklayouts · github.com/qarayahya/enable-global-styles · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/qarayahya/enable-global-styles/archive/refs/heads/main.zip

Readme

Enable Global Styles

Enables the full Global Styles editor in the Site Editor for classic and hybrid themes.

Classic and hybrid themes (classic themes with a theme.json) only get a read-only Style Book in the Site Editor (site-editor.php?p=/stylebook) — there is no Styles editing page (?p=/styles) like block themes have. WordPress still stores user style customizations in the wp_global_styles custom post type for every theme, so the data layer fully supports editing them.

This plugin replaces the static /stylebook route with a full Styles editing page:

  • The Global Styles UI (colors, typography, layout, per-block styles) in the content column — the same component block themes use.
  • A live Style Book preview that reflects unsaved changes as you edit.
  • Saving goes through the regular Site Editor Save flow, because edits are made via editEntityRecord( 'root', 'globalStyles', … ).

The existing "Styles" item in the Site Editor's main sidebar already points to /stylebook for classic themes, so the page is reachable without modifying the sidebar.

How it works

  1. The script loads only on site-editor.php, and only when the active theme is not a block theme.
  2. It opts into WordPress private APIs (__dangerousOptInToUnstableAPIsOnlyForCoreModules) to obtain unlock.
  3. It unlocks GlobalStylesUIWrapper, GlobalStylesActionMenu, StyleBookPreview, and useGlobalStyles from @wordpress/editor's private APIs, plus useLocation/useHistory from @wordpress/router.
  4. Once the Site Editor registers its routes, it dispatches the private unregisterRoute( 'stylebook' ) / registerRoute( … ) actions on the core/edit-site store to swap the route.

⚠️ Because this relies on private APIs (the consent string is version-pinned), it may need updating with future WordPress releases. Built and tested against WordPress 7.0.

Development

npm install
npm run build

Read the full README on GitHub →