ColorGradientsControl
dropdown shows incorrect label when the selected color value is using color-mix
CSS function
#64195
Labels
[Type] Bug
An existing feature does not function as intended
Description
I tried to create a color palette system that allows users to use 10% of current text color, 20% of current text color, and so on. To do this, I added a few colors in the
settings.color.palette
ontheme.json
file. The color values use thecolor-mix
CSS function to create the opacity effect.Here's the snippet:
The snippet works well it shows the correct CSS value both in the frontend and the editor.
However, when selecting the color in the
ColorGradientsControl
dropdown, it shows the wrong color label. It ALWAYS shows the10% of Current Text
(currentcolor-10
) label even when the selected color is thecurrentcolor-50
. Whencurrentcolor-50
color is selected, the correct label should be50% of Current Text
.Please look at the screenshot below, or watch the recorded video for a clearer demonstration.
This might be a very rare use case in theme or plugin development. But I think this should be still considered as a bug.
Step-by-step reproduction instructions
theme.json
.10% of Current Text
.Screenshots, screen recording, code snippet
Look at the screenshot below, I was selecting the 2nd box, which is the paragraph with
20% of Current Text
background color. TheColorGradientsControl
dropdown shows10% of Current Text
label even though the selected color palette is the20% of Current Text
.Or, please watch the video below:
gutenberg-colorgradientscontrol-bug.webm
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
The text was updated successfully, but these errors were encountered: