One of the most common theme customization requests we have seen here at Shopify Support are requests to change how the Add to Cart Button looks. Most commonly, button color, size, font color, and the border color and thickness. This tutorial will instruct you on editing the Add to Cart button and the Buy Button by adding some CSS to the bottom of your theme.scss.liquid file which you can then edit.
Note::
If you’re using a free theme from Shopify, then our Support team might be able to help you with this tutorial. Although Shopify can help you with many customizations, some kinds of customizations aren’t supported.
If you’re using a paid theme, then your theme was made by a third-party developer and Shopify’s Support team can’t help you with it. If you need help customizing a paid theme, then consider hiring a Shopify Expert. Similar to free themes, some kinds of customizations aren’t supported because of limitations associated with the theme or Shopify admin.
Disclaimer:
The “Buy it now” button is a dynamic checkout button. This button will change depending on the visitors’ payment preferences. You will not be able to change the styling or color of the branded dynamic checkout button (ShopPay, ApplePay, GooglePay, PayPal, AmazonPay, etc.)
Important:
The following tutorials are tested on themes published on Sept 2020
Additional Notes:
In the following tutorials, the first block of code is to change the appearance of the button. The second block of code, starting with /* Hover */ changes the button on hover, i.e. when the cursor hovers over the button.
background-color is to change the background color of the button.
border is to change the border. The first part, 2px, refers to the thickness of the border, second part, solid, is the border style, third part, green, is the color of the border. Please visit this page to learn more about CSS border properties.
color is to change the button label/text color.
You can also use hex color to match the button to your branding. Instead of writing the name of the color you would like the button to be you can input the hex code of the color found in this hex color picker online. For example, if you wanted a specific shade of purple you would input color: #7300ed; as opposed to color: purple;
Debut and Venture:
-
Go to Online Store > Themes > Actions > Edit Code and open the theme.scss.liquid.
-
To change the “Add to cart” button, paste the following code to the bottom of the file:
.product-form__cart-submit {
background-color: red;
border: 2px solid green;
color: white;
}
/* Hover */
.product-form__cart-submit:hover {
background-color: blue !important;
border: 2px solid orange !important;
color: green !important;
}
To change the “Buy it now” button, paste the code below:
.shopify-payment-button__button.shopify-payment-button__button--unbranded {
background-color: green !important;
border: 2px solid red !important;
color: white !important;
}
/* Hover */
.shopify-payment-button__button.shopify-payment-button__button--unbranded:hover {
background-color: blue !important;
border: 2px solid orange !important;
color: green !important;
}
-
Edit the values of background-color, border, and color to your liking.
-
Click Save.
Express:
-
Go to Online Store > Themes > Actions > Edit Code and open the theme.scss.liquid.
-
To change the “Add to cart” button, paste the following code to the bottom of the file:
.product-form__add-to-cart {
background-color: red;
border: 2px solid green;
color: white;
}
/* Hover */
.product-form__add-to-cart:hover {
background-color: blue !important;
border: 2px solid orange !important;
color: green !important;
}
To change the “Buy it now” button, paste the code below:
.shopify-payment-button__button.shopify-payment-button__button--unbranded {
background-color: green !important;
border: 2px solid red !important;
color: white !important;
}
/* Hover */
.shopify-payment-button__button.shopify-payment-button__button--unbranded:hover {
background-color: blue !important;
border: 2px solid orange !important;
color: green !important;
}
-
Edit the values of background-color, border, and color to your liking.
-
Click Save.
Simple:
-
Go to Online Store > Themes > Actions > Edit Code and open the theme.scss.liquid.
-
To change the “Add to cart” button, paste the following code to the bottom of the file:
.product-single__cart-submit {
background-color: red;
border: 2px solid green;
color: white;
}
/* Hover */
.product-single__cart-submit:hover {
background-color: blue !important;
border: 2px solid orange !important;
color: green !important;
}
To change the “Buy it now” button, paste the code below:
.shopify-payment-button__button.shopify-payment-button__button--unbranded {
background-color: green !important;
border: 2px solid red !important;
color: white !important;
}
/* Hover */
.shopify-payment-button__button.shopify-payment-button__button--unbranded:hover {
background-color: blue !important;
border: 2px solid orange !important;
color: green !important;
}
-
Edit the values of background-color, border, and color to your liking.
-
Click Save.
Boundless, Supply, and Brooklyn:
-
Go to Online Store > Themes > Actions > Edit Code and open the theme.scss.liquid.
-
To change the “Add to cart” button, paste the following code to the bottom of the file:
.btn.btn--add-to-cart {
background-color: red;
border: 2px solid green;
color: white;
}
/* Hover */
.btn.btn--add-to-cart:hover {
background-color: blue !important;
border: 2px solid orange !important;
color: green !important;
}
To change the “Buy it now” button, paste the code below
.shopify-payment-button__button.shopify-payment-button__button--unbranded {
background-color: green !important;
border: 2px solid red !important;
color: white !important;
}
/* Hover */
.shopify-payment-button__button.shopify-payment-button__button--unbranded:hover {
background-color: blue !important;
border: 2px solid orange !important;
color: green !important;
}
-
Edit the values of background-color, border, and color to your liking.
-
Click Save.
Minimal:
-
Go to Online Store > Themes > Actions > Edit Code and open the theme.scss.liquid.
-
To change “Add to cart” button, paste the following code to the bottom of the file:
#AddToCart {
background-color: red;
border: 2px solid green;
color: white;
}
/* Hover /*
#AddToCart:hover {
background-color: blue !important;
border: 2px solid orange !important;
color: green !important;
}
To change the “Buy it now” button, paste the code below:
.shopify-payment-button__button.shopify-payment-button__button--unbranded {
background-color: green !important;
border: 2px solid red !important;
color: white !important;
}
/* Hover */
.shopify-payment-button__button.shopify-payment-button__button--unbranded:hover {
background-color: blue !important;
border: 2px solid orange !important;
color: green !important;
}
-
Edit the values of background-color, border, and color to your liking.
-
Click Save.
Narrative**:**
-
Go to Online Store > Themes > Actions > Edit Code and open the theme.scss.liquid.
-
To change the “Add to cart” button, paste the following code to the bottom of the file:
.product__add-to-cart-button {
background-color: red;
color: white;
}
.product__add-to-cart-button::after {
outline: 2px solid green;
}
/* hover */
.btn--secondary:not(.disabled):hover {
color: black;
background: white;
}
.btn--secondary:not(.disabled):hover::after {
outline: 4px solid blue;
}
To change the “Buy it now” button, paste the code below:
.shopify-payment-button__button.shopify-payment-button__button--unbranded {
background-color: green;
color: white;
}
.shopify-payment-button__button.shopify-payment-button__button--unbranded::after {
outline: 2px solid red;
}
/* hover */
.shopify-payment-button__button.shopify-payment-button__button--unbranded:hover {
background-color: black;
color: red;
}
.shopify-payment-button__button.shopify-payment-button__button--unbranded:not(.disabled):hover::after {
outline: 4px solid blue;
}
-
Edit the values of background-color, border, and color to your liking.
-
Click Save.
