You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Styles: renaming a custom color causing the color to disappear across the site #50232
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended
I thought it is OK for users to change the name of the colors they defined in the global color palette because, sometimes, users may make typos or simply want to rename colors for clarity. However, with the current WordPress FSE, changing the name of a custom color will also change its corresponding CSS variable which causes the color to disappear from all elements across the site.
As shown in the first screenshot, a custom color name 'Color 1' is used as the border color of the group, the color of the title, and the background color of the submit button.
But when changing this 'Color 1' to 'Danger Color', the color disappears from all the elements mentioned above.
Proposed solution
Generating slugs as 'custom-color-1', 'custom-color-2', etc ... for custom color automatically while still allowing users to input custom labels for custom colors at their own will.
I can reproduce. I'm changing the label to Bug because from a user pov, this is absolutely unexpected behavior and breaks the site visually.
To be clear, I would expect the green color to be gone from the site if I deleted the color, but in this case, I am simply renaming the color.
One possible solution would be to prevent renaming after the color has been created. Restrict the feature so that you can only name the color at the time it is created.
Beyond that, you should be able to rename it at any time without affecting the site.
One possible solution would be to prevent renaming after the color has been created. Restrict the feature so that you can only name the color at the time it is created.
Or, likely detach the display name from the variable name. Variable name could stay the same if the colour display name is changed, or use a basic, numbered naming convention like --wp--preset--color--custom-1
changed the title [-]Changing Custom Color Name Breaks the Whole Site[/-][+]Styles: renaming a custom color causing the color to disappear across the site[/+]on Sep 25, 2026
Restrict the feature so that you can only name the color at the time it is created.
This I think is the safest option, good call.
Reason is, the custom preset might be applied to n unknown blocks around the site. It's better to create a new one, and make deleting them an explicit user decision.
Restrict the feature so that you can only name the color at the time it is created.
This I think is the safest option, good call.
Reason is, the custom preset might be applied to n unknown blocks around the site. It's better to create a new one, and make deleting them an explicit user decision.
Totally agree. The trade-off is that it will have inferior designing experience compared to Figma.
Your fix looks great and exactly what I had in mind. Keeping the slug unchanged when renaming the preset avoids the potential side effects. Great des exp.
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended
Activity
ndiego commentedon May 2, 2023
I can confirm and have updated the labels accordingly.
davewhitley commentedon Aug 25, 2026
I can reproduce. I'm changing the label to Bug because from a user pov, this is absolutely unexpected behavior and breaks the site visually.
To be clear, I would expect the green color to be gone from the site if I deleted the color, but in this case, I am simply renaming the color.
One possible solution would be to prevent renaming after the color has been created. Restrict the feature so that you can only name the color at the time it is created.
Beyond that, you should be able to rename it at any time without affecting the site.
CleanShot.2026-08-25.at.15.54.40.mp4
Nyiriland commentedon Aug 26, 2026
Or, likely detach the display name from the variable name. Variable name could stay the same if the colour display name is changed, or use a basic, numbered naming convention like
--wp--preset--color--custom-1[-]Changing Custom Color Name Breaks the Whole Site[/-][+]Styles: renaming a custom color causing the color to disappear across the site[/+]ramonjd commentedon Sep 27, 2026
This I think is the safest option, good call.
Reason is, the custom preset might be applied to
nunknown blocks around the site. It's better to create a new one, and make deleting them an explicit user decision.tiennguyenvan commentedon Sep 27, 2026
Totally agree. The trade-off is that it will have inferior designing experience compared to Figma.
ramonjd commentedon Sep 29, 2026
I have a small PR up here:
It allows renaming a custom colour, gradient or duotone but no longer changes the slug.
I don't have much time to go more deeply, so if this isn't satisfactory I'll close it.
tiennguyenvan commentedon Sep 29, 2026
Your fix looks great and exactly what I had in mind. Keeping the slug unchanged when renaming the preset avoids the potential side effects. Great des exp.
Thanks for putting this together, Ramonjd!
PaletteEdit: Stop changing the slug when renaming a preset
annezazu commentedon Sep 29, 2026
Thank you @ramonjd !