Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello, I tried to edit my assets under style.scss.liquid to display two items per row in mobile, with the following code; .collection-grid .medium-up--one-half {
width: 50%;
}
It did not fix the issue and when I tried to edit the code back to the original state the website display is seriously altered. www.borealiswoolco.com
Here is snapshot of where I tried to edit the code:
Thank you so much in advance!
****Update***
I've deleted the small bit of custom code beneath the "Custom Code Below Here" line and the site is now functioning properly. However, I would like to be able to re-enter the custom code in the correct format to get those changes active again. Can someone please have a look at it and see where the error(s) are?
Thanks folks!
Solved! Go to the solution
This is an accepted solution.
Hi @Woolnerd13 ,
You just need to use display grid. In your style.css add the code below.
@media only screen and (max-width: 481px) {
.grid.product-list {
display: grid !important;
grid-template-columns: 1fr 1fr !important;
}
}
This is an accepted solution.
Hi @Woolnerd13 ,
Try to remove this two curly brackets. I don't think there should be curly brackets there. Check the image below.
This is an accepted solution.
Sorry. It is me. It should be display, not dsiplay. Corrected the code below.
.grid.product-list.clearfix::before {
display: none !important;
}
This is an accepted solution.
Hi @Woolnerd13 ,
You just need to use display grid. In your style.css add the code below.
@media only screen and (max-width: 481px) {
.grid.product-list {
display: grid !important;
grid-template-columns: 1fr 1fr !important;
}
}
Thanks for this. I assume this addresses the display of two items per row on mobile issue?
Could you please also look at the existing custom code from my screen shot and see if there are any errors there?
This is an accepted solution.
Hi @Woolnerd13 ,
Try to remove this two curly brackets. I don't think there should be curly brackets there. Check the image below.
Yup this works for the display issue! However, it did not evenly distribute the rows and so there is a blank item on both the top and bottom row, which are the only rows displaying only one item. How can I fix this?
Hi @Woolnerd13 ,
This is because of the clearfix pseudo. We can hide the :before. Just add this code below.
.grid.product-list.clearfix::before {
dsiplay: none !important;
}
Hmm, so I've added the code but I still have the blank rows on mobile. Maybe there is an error in how I entered it?
This is an accepted solution.
Sorry. It is me. It should be display, not dsiplay. Corrected the code below.
.grid.product-list.clearfix::before {
display: none !important;
}
Wow, incredible. You have saved me a lot of worry! This is my first time changing code, and somehow with your help I have got it right! Thank you Made4Uo!
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024