I am using the Dawn theme (15.3.0) and wondered if anyone could help with a custom code to remove something from being shown on a mobile device but keep them live on desktop, is this possible?
I have attached pdf showing the 5 text boxes, first image in pdf is desktop and second is view on a mobile.
Go to Online Store, then Theme, and select Edit Code.
Search for base.css/theme.css/style.css/main.css/custom.css file Add the provided code at the end of the file.
Yes, absolutely possible! You can hide those text boxes on mobile while keeping them visible on desktop using CSS media queries. Here’s how:
Solution: Add mobile-specific CSS
Go to Shopify Admin → Online Store → Themes → Actions → Edit Code
Find assets/base.css or create a new file called custom.css in the assets folder
Add this code:
/* Hide text boxes on mobile devices */
@media screen and (max-width: 749px) {
.rich-text,
.rich-text__wrapper,
.rich-text__blocks {
display: none !important;
}
}
/* If the above doesn't target the right elements, try this more specific approach */
@media screen and (max-width: 749px) {
.section-rich-text {
display: none !important;
}
}
If you created a new CSS file, you’ll also need to include it in your theme:
Open layout/theme.liquid
Add this line in the section:
{{ 'custom.css' | asset_url | stylesheet_tag }}
The max-width: 749px targets mobile devices, and Dawn theme typically uses this breakpoint. The !important ensures it overrides any existing styles.
Test it: Save the changes and check your site on mobile - those text boxes should now be hidden on mobile but still visible on desktop!
Easier alternative: If you plan on making more mobile-specific changes or want a visual way to handle this, I built an app called Easy Edits that lets you create separate edits for mobile and desktop views. You could easily hide those text boxes on mobile with just a few clicks, no code needed!
Let me know if this works for you or if you need help targeting different elements!