Archived topic
Global Colors Class bug?
3 replies · Started by Thomas on February 13, 2022
I defined in /wp-admin/customize.php a global color orange1.
/wp-content/uploads/generatepress/style.min.css sets this:
.has-orange1-color{color:#FCC25E;}.has-orange1-background-color{background-color:#FCC25E;}
The vanilla Gutenberg P block looks like this:
<p class="has-orange-1-background-color has-background">
Look at orange-1 vs. orange1.
As a workaround, I changed the name to orange-1. This corrects style.min.css while not changing the block's class.
My issue is solved but I wanted to file the bug.
Thomas
Hi there,
i am not sure i follow - how did you define the color in /wp-admin/customize.php ?
This is the working setting with dash. Without dash, it was broken.
https://ibb.co/JmSk45G
Hi there,
This is due to the desired naming convention that WordPress has used in its helper classes. They make sure there are - characters between words and numbers, even if the user defines otherwise.
Not sure why they did it, but I don't think it's something they can change now.
We did our best to "autocorrect" Global Color naming, but this particular one was very hard to accomplish, unfortunately. We'll keep playing with it.
Thanks! :)