Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello,
I have been making changes to my website, however anything that I do in theme.css only changes on desktop and not mobile...
my website (streamline theme): https://yuggen.org/collections/all-products/products/yuggen-reusable-silicone-ziplock-bag-small-size
For example, change the color of "add to cart" button, which only changed on the desktop... same happened when I reduced padding of the alternative section. It only works on the desktop view.
code pasted in theme.css.liquid:
button.btn.btn--tertiary.btn--full.add-to-cart {
color: white;
background-color: #591010;
border: none;
}
button.shopify-payment-button__button.shopify-payment-button__button--unbranded._2ogcW-Q9I-rgsSkNbRiJzA._2EiMjnumZ6FVtlC7RViKtj._2-dUletcCZ2ZL1aaH0GXxT {
background: #3E4430 ;
color: white;
}
What could be the reason? Thank you
Solved! Go to the solution
This is an accepted solution.
Hi @nvg,
I checked and your code is included inside '@media only screen and (min-width: 750px) {' so when you add new code it will only work on desktop and tablet, not mobile.
If you want it to work for all devices, please remove this:
Hope it helps!
Hello There,
1. In your Shopify Admin go-to online store > themes > actions > edit code
2. Find Asset >theme.css and paste this at the bottom of the file:
button.btn.btn--tertiary.btn--full.add-to-cart {
color: white;
background-color: #668913!important;
border: none;
}
button.shopify-payment-button__button.shopify-payment-button__button--unbranded._2ogcW-Q9I-rgsSkNbRiJzA._2EiMjnumZ6FVtlC7RViKtj._2-dUletcCZ2ZL1aaH0GXxT {
background: #3E4430!important;
color: white;
}
Desktop Screenshot:- https://prnt.sc/48WChLu3X9x_
Mobile Screenshot:- https://prnt.sc/nBhzMBf-qx51
Hello There,
1. In your Shopify Admin go-to online store > themes > actions > edit code
2. Find Asset >theme.css and paste this at the bottom of the file:
@media only screen and (max-width: 750px){
button.btn.btn--tertiary.btn--full.add-to-cart {
color: white;
background-color: #591010;
border: none;
}
}
Screenshot:-https://prnt.sc/0gJd_Q1ZNaNG
This is an accepted solution.
Hi @nvg,
I checked and your code is included inside '@media only screen and (min-width: 750px) {' so when you add new code it will only work on desktop and tablet, not mobile.
If you want it to work for all devices, please remove this:
Hope it helps!
It worked like a charm, thank you so much! I spent so much time trying to figure it out before. Really appreciate your help 🙂
Hi @nvg,
If you have any further questions, you can contact me.
Happy to help you.
After using this code, all my work in my base.css was destroyed. I was unable to revert back, and now my mobile version of my site is completely ruined! To anyone reading this, please do not delete this line of code in your css.
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025