I have a button that I must set the background color of using CSS rather than in the builder settings. This is required for an effect to work.
I’m setting the color using {{dc:}} syntax to grab a meta value where the color for the category is defined.
It uses the color as expected when I put my {{dc:}} parameter into various color fields on the builder settings. Each button gets the color for its category.
The problem occurs when I put it in the element CSS on an archive layout. Instead of the CSS displaying the color associated with the button category, it’s using the color associated with the archive page itself. Where the CSS comes into play, all buttons are the same color as the color defined for the archive category instead of their own colors.
This is happening even though the button is inside a looper provider that should be limiting the scope of the possible values.
Should {{dc:}} values in the button element CSS return the value for the button, which is what I’d expect, or should it return a value as if it is just part of the page/layout itself, which is what is happening?
If element CSS scope isn’t limited to the element but rather to the page or layout, I can see this causing unexpected results whenever someone uses {{dc:}} parameters in their element CSS.
The parameter I’m using for all this is from an ACF field and it’s {{dc:term:meta key=“category_color”}}