We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Add to Cart Button Style Not Applying on Desktop

Solved

Add to Cart Button Style Not Applying on Desktop

Mab5
New Member
6 0 0

Can someone please guide me? I changed the "Add to Cart" button color using the following code:

 

.product-form__submit {
background: #9db396 !important;
color: #ffffff !important;
font-weight: bold;

}


I added this code at the end of the base.css file. Initially, it worked perfectly, but after a few days, it suddenly stopped applying on the laptop screen — although it still works fine on mobile.

I can see the updated styling on mobile, but not on the laptop.

I also tried changing the button color from the theme settings, but that doesn’t seem to affect this button either.

Can anyone help me understand why this is happening and how I can fix it?


Can you please help me how can i resolve this isuue?

Accepted Solution (1)
topnewyork
Astronaut
1552 191 253

This is an accepted solution.

Hi @Mab5,


1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.css / based.css file and paste the code in the bottom of the file.

 

@media screen and (min-width: 768px) {
.product-form__submit,
button.product-form__submit {
  background: #9db396 !important;
  color: #ffffff !important;
  font-weight: bold !important;
 }
}

 


Thanks!

Need a Shopify developer? Hire us at Top New York Web Design
Boost Your Store Sales with Volume/Tier Discount Try Big Bulk Discount
Create New Shopify Store For Just 1$/Month

View solution in original post

Replies 12 (12)

websensepro
Shopify Partner
2144 268 319

Hello @Mab5 ,

 

kindly provide your store URL please and if it is password protected, please share the password as well.

 

Thanks!

Need a Shopify developer? Hire us at WebSensePro For Shopify Design Changes/Coding
For Free Tutorials Subscribe to our youtube
Get More Sales Using Big Bulk Discount APP
Create Your Shopify Store For Just 1$/Month
Get More Sales Using Big Bulk Discount APP
Mab5
New Member
6 0 0

Thanks for getting back to me. Here’s the website URL: https://amsonsdesign.au/.
It seems that none of the custom CSS is working on the laptop — not just the Add to Cart button.

BiDeal-Discount
Shopify Partner
819 109 182

Hi @Mab5 

I guess we have some other style overriden this.

To resolve this issue, let share me your store url & password (if applicable) to let me check why & give you the solution

- Helpful? Like & Accept solution! Coffee tips fuel my dedication.
- BiDeal Bundle Volume Discounts: Upsell with discount bundles, quantity breaks, volume discounts & mix-and-match bundles. AOV+ with free gifts, free shipping & progressive cart
- Contact me via WhatsApp
Mab5
New Member
6 0 0

Thanks for getting back to me. Here’s the website URL: https://amsonsdesign.au/.
It seems that none of the custom CSS is working on the laptop — not just the Add to Cart button.

topnewyork
Astronaut
1552 191 253

This is an accepted solution.

Hi @Mab5,


1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.css / based.css file and paste the code in the bottom of the file.

 

@media screen and (min-width: 768px) {
.product-form__submit,
button.product-form__submit {
  background: #9db396 !important;
  color: #ffffff !important;
  font-weight: bold !important;
 }
}

 


Thanks!

Need a Shopify developer? Hire us at Top New York Web Design
Boost Your Store Sales with Volume/Tier Discount Try Big Bulk Discount
Create New Shopify Store For Just 1$/Month
BiDeal-Discount
Shopify Partner
819 109 182

Hi @Mab5 

The main reason is your file base.css have wrong syntax so some of styling will be missing

https://amsonsdesign.au/cdn/shop/t/10/assets/base.css?v=116716085513132832661750773410

 

BiDealDiscount_0-1750774726629.png

 

- Helpful? Like & Accept solution! Coffee tips fuel my dedication.
- BiDeal Bundle Volume Discounts: Upsell with discount bundles, quantity breaks, volume discounts & mix-and-match bundles. AOV+ with free gifts, free shipping & progressive cart
- Contact me via WhatsApp
Mab5
New Member
6 0 0

Thanks for getting back to me. Can you please share the correct syntax?

Mab5
New Member
6 0 0

All the codes as working now. Thanks a lot. 

Mab5
New Member
6 0 0

All the code changes are working now, but something seems to be wrong with my home banner. Could you please take a look and help me fix it?

topnewyork
Astronaut
1552 191 253

Hi @Mab5,


1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.css / based.css file and paste the code in the bottom of the file.

@media screen and (min-width: 768px) {
.product-form__submit,
button.product-form__submit {
  background: #9db396 !important;
  color: #ffffff !important;
  font-weight: bold !important;
 }
}


Thanks!

Need a Shopify developer? Hire us at Top New York Web Design
Boost Your Store Sales with Volume/Tier Discount Try Big Bulk Discount
Create New Shopify Store For Just 1$/Month

jakeclifford
Shopify Partner
93 18 25

Hi @Mab5,

Below the current code please try the following 

@media screen and (min-width: 768px) {
  .product-form__submit {
    background: #9db396 !important;
    color: #ffffff !important;
    font-weight: bold !important;
  }
}

 

Also make sure the you hard refresh the page, to do this hold shift and click browser refresh.

Hope that helps,
Jake 

I'm Jake the Shopify Wizard! If helpful Like and Mark as an Accepted Solution
My Blog - Tips and Tricks for Shopify Horizon and AI features Horizon + AI

Struggling to solve an annoying issue? Get Help Fast

tim
Shopify Partner
4812 598 1733

Here is the final part of your assets/base.css -- I've reformatted it a bit to better show nesting.

 

You should be careful with curly braces and each opening brace must have a matching closing one.

Here we see that you have opening brace on the first line, but it has no closing one, meaning that your code for product form submit button is also inside this media query and apllies only on narrow screen.

 

Also, there is no closing brace for .card-wrapper .badge rule which makes it a bit weird.

Since all this code is a customization, you need to decide where to close these rules/

 

@media (max-width: 767px){

    .banner__media img {
        object-fit: contain !important;
    }

    .banner__media.media {
        height: 23rem !important;
    }

    #HeaderMenu-New Arrivals > span {
        color: #ff9900;
    }

    .product-form__submit {
        background: #9db396 !important;
        color: #ffffff !important;
    font-weight: bold;
    }

    .product__title > * {
        font-size: 20px !important;
    }

    .price__badge-sale {
        color: #23282f!important;
    }
    .card-wrapper .badge {
        color: #ffffff;

        .badge.price__badge-sale {
            background-color: #ffffff ;
        }

 

 

If my post is helpful, hit the thumb up button -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com