Background add-to-cart-button


When we try to change the background color of add-to-cart-button, using the .buttonText doesn’t work, obviously. Because this is only the element with the text.
So we tried with .buttonDataContainer, without sucess too.

Any tip to change all the background color of this button?

other way to change background color and other attributes maybe is that way. in the product summary I’m using “product-summary-buy-button” and when you want to change attributes in the css file write .buyButton :global(.vtex-button) {} that is the way . I dont know if this answer your question

Thank for you reply @andreslarrotta
With “product-summary-buy-button” we can change background color with “buyButtonContainer”

But the blue background remains… I don’t know why :confused:
How you manage to change entire background color?

And the reason for us use “add-to-the-cart instead” of “buy-button” is the modal cart that have in minicart v2

Did you tried to change action-primary in the style.json in styles folders?, there you can see the setup attributes about all , so only need search a primary and see what attributes have

1 Like

Exaclty @andreslarrotta
While you was writing this reply I was trying the same and finally works!
In “semanticColors” I changed the values and work’s like a charm.

Thank for the support!

1 Like

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