Button:hover stopped working

Topic summary

A user’s CSS button hover effects suddenly stopped working after accidentally enabling automatic formatting. The issue affects both general button hover styles (text-transform, box-shadow, border) and product-specific color changes on hover.

Root cause identified: The original code contained a malformed CSS comment (*/button hover color on product page*/ instead of /* button hover color on product page */), which likely broke the CSS parsing.

Solutions attempted:

  • Changing .button:hover to button:hover (element selector instead of class)
  • Using more robust attribute selectors like button[id*="product-id-submit"]:hover to target specific product buttons
  • Correcting the comment syntax

Current status: Despite multiple code suggestions from community members, including corrected syntax and improved selectors, the user reports the hover effects still aren’t working. One helper offered to provide free direct assistance via collaborator access to investigate deeper issues that may be interfering with the CSS.

The discussion remains unresolved, with the possibility of additional conflicts in the theme code that require hands-on debugging.

Summarized with AI on October 31. AI used: claude-sonnet-4-5-20250929.

Hey guys,

Website is

www.phreshcareco.com.au

Button:hover doesn’t seem to work anymore - i accidentally got automatic formatting on, not sure why but as soon as i clicked it over is started getting issues.

This is what i use it for code below.

/* button hover effect */
  .button:hover {
    text-transform: uppercase;
    box-shadow: 0 0 10px #181e40 !important;
    border: 2px solid #181e40 !important;
  }
  */button hover color on product page*/ 
  
  .button#quick-add-template--22881209352507__product-grid9604785439035-submit:hover {
    background-color: #ff2800 !important;
    color: #181e40;
  }
  .button#quick-add-template--22881209352507__product-grid9641567158587-submit:hover {
    background-color: #f2f427 !important;
    color: #181e40;
  }
  .button#quick-add-template--22881209352507__product-grid9614441054523-submit:hover {
    background-color: #8fc128 !important;
    color: #181e40;
  }
  .button#quick-add-template--22881209352507__product-grid9605425594683-submit:hover {
    background-color: #08c7e4 !important;
    color: #181e40;
  }
  .button#quick-add-template--22881209352507__product-grid9641599566139-submit:hover {
    background-color: #fb6445 !important;
    color: #181e40;
  }

I am still really new to coding. Self taught from youtube/chat GPT.

Was wondering if someone could help me out see why it is not working?

1 Like

You can try to updat your code to this and check again

/* button hover effect */
  button:hover {
    text-transform: uppercase;
    box-shadow: 0 0 10px #181e40 !important;
    border: 2px solid #181e40 !important;
  }
  */button hover color on product page*/ 
  
  button#quick-add-template--22881209352507__product-grid9604785439035-submit:hover {
    background-color: #ff2800 !important;
    color: #181e40;
  }
  button#quick-add-template--22881209352507__product-grid9641567158587-submit:hover {
    background-color: #f2f427 !important;
    color: #181e40;
  }
  button#quick-add-template--22881209352507__product-grid9614441054523-submit:hover {
    background-color: #8fc128 !important;
    color: #181e40;
  }
  button#quick-add-template--22881209352507__product-grid9605425594683-submit:hover {
    background-color: #08c7e4 !important;
    color: #181e40;
  }
  button#quick-add-template--22881209352507__product-grid9641599566139-submit:hover {
    background-color: #fb6445 !important;
    color: #181e40;
  }

For black dot Appearing, You can debug this yourself using the browser DevTools or by downloading and editing the theme in VS Code. Use VS Code’s search functionality to locate the issue.

If you have a backup of the theme and the current theme, uploading it to GitHub can help compare changes and identify what went wrong.

Hi @Phreshcareco You can try this code

/* button hover effect */
    text-transform: uppercase;
    box-shadow: 0 0 10px #181e40 !important;
    border: 2px solid #181e40 !important;
    background-color: #ff2800 !important;
    color: #181e40;
  }

Result

Best,

Liz

Thanks for reply but unfortunately still not working…

Thanks for reply but need all the buttons to have different colours and this wont fix why there is no hover over button.

Hey @Nilankar ,

Ive searched the dev tool i cant find anything. I am not too concerned about the dot, my main concern is why the button.hover css just suddenly stopped working.
Got any ideas?

Hey @Phreshcareco ,

I see the issue! Try this:

/* General button hover effect */
.button--primary:hover,
button.button--primary:hover,
.quick-add__submit:hover {
  text-transform: uppercase;
  box-shadow: 0 0 10px #181e40 !important;
  border: 2px solid #181e40 !important;
}

/* Button hover color on product page - Fruit Fusion (red) */
button[id*="9604785439035-submit"]:hover {
  background-color: #ff2800 !important;
  color: #181e40 !important;
}

/* Button hover color on product page - Good Stuff (yellow) */
button[id*="9641567158587-submit"]:hover {
  background-color: #f2f427 !important;
  color: #181e40 !important;
}

/* Button hover color on product page - Secret Weapon (green) */
button[id*="9614441054523-submit"]:hover {
  background-color: #8fc128 !important;
  color: #181e40 !important;
}

/* Button hover color on product page - Steel Eye (blue) */
button[id*="9605425594683-submit"]:hover {
  background-color: #08c7e4 !important;
  color: #181e40 !important;
}

/* Button hover color on product page - Alpha Phresh (orange) */
button[id*="9641599566139-submit"]:hover {
  background-color: #fb6445 !important;
  color: #181e40 !important;
}

The key changes I’ve made:

  1. The main issue was that you were using selectors like .button#quick-add-… when the elements are actually elements with the class .quick-add__submit and class .button–primary
  2. I’ve made the selectors more robust by using attribute selectors with a wildcard ([id*=“9604785439035-submit”]). This targets any button with an ID containing those product numbers, which will be more resilient to theme updates or changes.
  3. I’ve added comments to identify which product each color corresponds to, making it easier to manage in the future.
  4. I’ve kept the general hover effect for all buttons that should apply universally, while the specific color changes are applied to individual products.

Feel free to reach out in case you’ve any more questions for me :slightly_smiling_face:

Cheers!
Shubham | Untechnickle

@TheUntechnickle Thank-you for your code - but unfortunately that still did not work. I was so hopeful about it, was written out so nicely. I do appreciate it. But do you think theres anything else that could be compromising it?

The very first code that you’ve written, I can see the error. The comment is formatted wrong, instead of this

/button hover color on product page/

Use this:
/* button hover color on product page */

That might be causing all the conflict! Let me know if this works, else you can share your collaborator code we’d love to dig deep and fix it for free :slightly_smiling_face:

Cheers!
Shubham | Untechnickle

That’s the updated code:

/* button hover effect */
.button:hover {
  text-transform: uppercase;
  box-shadow: 0 0 10px #181e40 !important;
  border: 2px solid #181e40 !important;
}

/* button hover color on product page */ 
.button#quick-add-template--22881209352507__product-grid9604785439035-submit:hover {
  background-color: #ff2800 !important;
  color: #181e40 !important;
}

.button#quick-add-template--22881209352507__product-grid9641567158587-submit:hover {
  background-color: #f2f427 !important;
  color: #181e40 !important;
}

.button#quick-add-template--22881209352507__product-grid9614441054523-submit:hover {
  background-color: #8fc128 !important;
  color: #181e40 !important;
}

.button#quick-add-template--22881209352507__product-grid9605425594683-submit:hover {
  background-color: #08c7e4 !important;
  color: #181e40 !important;
}

.button#quick-add-template--22881209352507__product-grid9641599566139-submit:hover {
  background-color: #fb6445 !important;
  color: #181e40 !important;
}
1 Like

Please help me, Sir. Thank you.

https://community.shopify.com/c/shopify-design/newsletter-form-issue-in-footer-section-dawn-theme/m-p/2971833#M778491