Cornerstone global colors - validation for duplicates

I have not noticed from which version onwards the possibility to edit the ID of the color was activated for the Cornerstone colors.

But the whole thing should be treated with caution. As long as you leave the ID’s unique, it is no problem to assign a second color with the same name. (Which of course also makes no sense, but this is a technical question)

If I assign an ID twice, a third color appears!

screenshot_ 2025-04-04 um 09.25.39

And when I add another one with the same ID it gets crazy!

screenshot_ 2025-04-04 um 09.29.30

I think it’s good that you can at least see the ID to use it for a CS shortcode, for example. But the field should be set to “readonly”, or only be displayed as text at all. I see no reason why you should change this yourself. If absolutely necessary, you can also do it via the DevTool.

If it is still desired that you can also change the ID in the color editor, then at least a validation for duplicates must be introduced!

Hello @Regnalf,

Thank you for the inquiry.

We tried manually changing the ID of one color using the ID of another, which disabled the other color, but it didn’t automatically create a new color. By default, colors cannot have the same ID, which is why this ID is automatically generated, but it can be defined manually if necessary. This can be useful if you’re trying to define colors by memory using dynamic content. Example:

{{ global.color({"id":"myfavoritecolor"}) }}

Yes, we agree that validation can be useful in this case, but in our previous tests, all it did was disable the other color.

Kind regards.

Maybe it’s because i halve also some theme.co preset colors in the list? They are all in the same json field.

Ah yes, we’re able to reproduce the issue on an installation with the preset colors, but it only happens when intentionally copy pasting the same color ID to another. We’ll forward this to our channel.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.