cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.3.1 add to cart button background color

Magento 2.3.1 add to cart button background color

I would like to change in Magento v.2.3.1 "Add to cart" button background color from blue to black. (Luna theme).

Will you advice me how to do that please? I will appreciate any idea. 

 

2 REPLIES 2

Re: Magento 2.3.1 add to cart button background color

Hi @jan_zaczynski 

 

I think you can achieve this by edit you theme style in CSS file. Here is the link of Magento Guide will help you in customize your style file.

 

I hope it will help you.

Thanks
--
If my answer is useful, please Accept as Solution & give Kudos

Re: Magento 2.3.1 add to cart button background color

Hello @jan_zaczynski 

 

you will require to edit the css file of luma theme and change the color based on your need.

 

Location of the file is - vendor/magento/theme-frontend-luma/Magento_Theme/web/css/source/_module.less

 

Don't edit directly in the core files - you will require to create a child theme/custom theme for your requirement in the app/design/VendorName/ThemeName directory

 

Then create your own css file - keeping parent theme as luma and now you will require to change the color of the add-to-cart button.

 

it is coming from the below class so i have changed it to black :

 

action tocart primary

.action.primary{
background:#000000;
}

 

You can refer this article to know about how to create a custom theme - https://www.magestore.com/magento-2-tutorial/3171-2/

 

Also refer this one - https://community.magento.com/t5/Magento-2-x-PWA-Theming-Layout/How-to-change-a-color-on-the-Luma-th...

 

Hope it helps !

if issue solved,Click Kudos & Accept as Solution