WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.44k stars 4.17k forks source link

Global Styles - Custom Colors given the same name cannot be applied properly #49593

Open cuemarie opened 1 year ago

cuemarie commented 1 year ago

Description

If custom colors are added in the global styles theme settings with the same name (eg Color 1), it becomes impossible to select any color but the last custom color of that name.

Step-by-step reproduction instructions

  1. Start in site editor
  2. Select global styles
  3. Colors>Palettes>Custom Colors, add custom colors
  4. Select "Show Details" in the menu for custom colors, and rename all the colors to the same name, such as "Color 1"
  5. Return to the editor, and try selecting one of these custom color for any block color setting

Screenshots, screen recording, code snippet

Setup

Markup on 2023-04-04 at 13:35:31

Result

Markup on 2023-04-04 at 13:37:48

Environment info

Originally reported here: https://github.com/Automattic/wp-calypso/issues/75197 Replicated in WP version 6.2 with all Gutenberg plugin active and deactivated. Theme: Twenty Twenty-Three

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

aaronrobertshaw commented 1 year ago

I believe this issue might be considered a duplicate of https://github.com/WordPress/gutenberg/issues/43197.

The issue was also touched on in a related PR https://github.com/WordPress/gutenberg/pull/43096#issuecomment-1210321423.

ramonjd commented 2 weeks ago

I added some thoughts over in: https://github.com/WordPress/gutenberg/issues/43197#issuecomment-2370177475