Skip to content

Feat: add option to remove custom- prefix from color slugs#822

Open
Verma-Punit wants to merge 3 commits intoWordPress:trunkfrom
Verma-Punit:feat/821-blank-theme-color-slugs
Open

Feat: add option to remove custom- prefix from color slugs#822
Verma-Punit wants to merge 3 commits intoWordPress:trunkfrom
Verma-Punit:feat/821-blank-theme-color-slugs

Conversation

@Verma-Punit
Copy link
Copy Markdown

Summary

Adds an opt-in save option to remove the custom- prefix from editor-created color slugs when saving Global Styles to theme.json.

This helps new blank themes save cleaner palette slugs such as base, contrast, and accent instead of custom-base, custom-contrast, and custom-accent. The option is disabled by default so existing content that already uses custom-* color slugs remains unchanged unless the user explicitly enables it.

The normalization also updates saved style references and avoids renaming when the unprefixed slug would conflict with an existing theme color slug.

Resolved Issue

Fixes #821

Checklist

  • PHP lint passes with npm run lint:php
  • PHPCS passes for touched PHP files
  • PHP syntax checks pass for touched PHP files
  • Tests added for the reported issue

Screen Recording

Screen.Recording.2026-04-20.at.3.41.24.PM.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Blank Theme: Color palette remove "custom-" prefix

1 participant