#54573 closed defect (bug) (reported-upstream)
Reserved color slugs in theme.json?
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Editor | Keywords: | |
Focuses: | Cc: |
Description
This appears to only be an issue in 5.9 Beta 1 and not in Gutenberg 12+. If you register a color palette in your theme's theme.json
with the custom color slugs are the same as those in Core's default color palette, they do not show up in the editor.
For example, the default color palette in Core has both black
and white
slugs, and therefore, it appears that you cannot register the same slugs in a theme. They simply do not show up. What is strange is that if you active Gutenberg, the black
and white
colors appear as they should in the "Theme" section of the color picker component.
So there must be a discrepancy in the way that Core and Gutenberg handle the core/default color palette slugs. If these slugs are truly "reserved" and cannot be used in theme, we should add that to the handbook.
Change History (7)
#2
@
4 years ago
This change was intentional and the ability of themes to overwrite the default palette was removed https://github.com/WordPress/gutenberg/pull/36811. The same should happen with Gutenberg during the next update.
We are considering the possibility of allowing overwrites if the default palette is disabled https://github.com/WordPress/gutenberg/pull/37008.
#3
@
4 years ago
@jorgefilipecosta if this is the case, we should make sure that the list of default/core color slugs are listed in the handbook as "reserved", probably here https://developer.wordpress.org/themes/advanced-topics/theme-json/#color. That said, I absolutely feel that if the default/core palette is disabled, themes should be able to register anything they like.
#4
@
4 years ago
An alternative option could just be to prefix the default/core colors. Something like wp-default-black
. This would remove a lot of conflicts for themes.
#5
@
4 years ago
- Resolution set to reported-upstream
- Status changed from new to closed
This issue has been resolved in Gutenberg, so I am closing this ticket.
Merged PR in Gutenberg: https://github.com/WordPress/gutenberg/pull/37008
@jorgefilipecosta or @oandregal should know more here, I believe this was discussed at some point.