How can I change the color of my 'Add to Cart' button hover?

Hi guys,

I would like to edit the Add to card button hover.

Instead of ‘expanding’ the border as it is, I want the border and text to change color to linear-gradient( #4568DC , #B06AB3).

My url; https://189ee3-2.myshopify.com/products/demin

Thank you!

1 Like

Hi @collins276

Check this one.

From your Shopify admin dashboard, click on “Online Store” and then “Themes”.

Find the theme that you want to edit and click on “Actions” and then “Edit code”.

In the “Assets” folder, click on “base.css, style.css or theme.css” file, depending on which file your theme uses to store its CSS styles. At the bottom of the file, add the following CSS code:

.button:before, .button:hover, .button:focus-visible,
.button:focus, .button:after, .button:not([disabled]):hover::after {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5) !important;
}
.button, .button:hover {
background:linear-gradient( #4568DC , #B06AB3) !important;
}
.button span {
    color: white !important;
}

And save.

Result:

Please don’t forget to Like and Mark Solution to the post that helped you. Thanks!

1 Like

Sorry for not clarifying my question. This is how I want it to be (as hover)

1 Like

check this one.

.button:after, .button:hover, .button:before {
    box-shadow: none !important;
}
.button {
    border: 1px solid;
    transition: border-color 0.3s ease;
}
.button:hover {
    border-image: linear-gradient(#4568DC, #B06AB3) 1;
    border-image-slice: 1; 
    border-width: 1px;
}

.button {
    position: relative;
}
.button span {
  transition: color 0.3s ease; 
}

.button:hover span {
  background: linear-gradient(#4568DC, #B06AB3);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

And Save.

Result:

Please don’t forget to Like and Mark Solution to the post that helped you. Thanks!

1 Like

Thank you so much :+1: :grinning_face:

1 Like