Problem/Motivation

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}}";
  }

Steps to reproduce

Proposed resolution

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.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

szeidler created an issue.