Active
Project:
Gutenberg
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Jul 2026 at 19:04 UTC
Updated:
24 Jul 2026 at 19:04 UTC
Jump to comment: Most recent
In Gutenberg 8.x-2.x when you use custom color palette the generated CSS is based on the color name instead of the slug. https://git.drupalcode.org/project/gutenberg/-/blob/8.x-2.x/gutenberg.mo...
// Generate minified palette styles.
foreach ($theme_definition['theme-support']['colors'] as $color) {
$color_name = Html::getClass($color['name']);
$color_value = $color['color'];
$css_markup .= ":root .has-{$color_name}-color{color:{$color_value}}";
$css_markup .= ":root .has-{$color_name}-background-color{background-color:{$color_value}}";
}
It rather should use the slug, because the slug is was is written into the markup in the Gutenberg editor.
In Gutenberg 3.x this problem is fixed by all the restructurings on that release branch.
Comments