Taming the Instagram Scroll: Fixing Glitchy Animations in Shopify's Dawn Theme

Hey everyone! As a Shopify migration expert, I spend a lot of time digging through the community forums, and a common pain point I've seen pop up recently involves the popular Dawn theme and its sometimes-tricky relationship with the Instagram in-app browser. It's a real head-scratcher when your beautiful site looks perfect everywhere else, but then gets all wonky on Instagram, right?

I recently followed a thread where a store owner, HP92P, was wrestling with exactly this. Their royajewellery.co.uk site, running on Dawn theme 15.4.1, was experiencing some seriously glitchy scrolling behavior. Specifically, the 'reveal on scroll' animations for their Featured Collections and Multicolumn sections were getting sticky and choppy, completely ruining the customer experience for folks clicking through from Instagram. On regular mobile browsers like Chrome, everything was smooth as silk – classic in-app browser shenanigans!

HP92P even shared a video of the issue, which really highlighted the problem. It looked something like this:

It's super frustrating when a core theme feature like 'reveal sections on scroll' causes problems, especially when you want that slick animation! Turning it off was a temporary fix, but nobody wants to compromise on design.

First Attempts and Lessons Learned

Early in the thread, a community member named Mustafa_Ali jumped in with a common workaround: detecting the Instagram browser and disabling animations specifically for it. Here's what they suggested:

Step 1: Add JavaScript to detect Instagram Browser

Go to your Shopify admin, then navigate to Online Store → Themes → Edit Code → assets/theme.js. Paste this code at the bottom of the file:

if (navigator.userAgent.includes('Instagram')) {
  document.documentElement.classList.add('instagram-browser');
}

Step 2: Add CSS to disable animations

Next, open assets/base.css and paste this at the bottom:

.instagram-browser .scroll-trigger,
.instagram-browser .scroll-trigger.animate--slide-in,
.instagram-browser .scroll-trigger.animate--fade-in {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

This approach is designed to essentially turn off those reveal animations when Instagram's browser is detected, ensuring content just appears normally rather than glitching. However, HP92P quickly reported back that this solution, unfortunately, didn't work for them. This tells us that sometimes a simple fix isn't enough, and these in-app browser quirks can be surprisingly stubborn.

A More Comprehensive Community Solution

After HP92P's initial feedback, another helpful community member, Wsp, stepped in with a much more comprehensive solution. This one tackles several potential issues at once, aiming for a more robust fix. While HP92P didn't explicitly confirm if this final suggestion solved their problem in the thread, it's the most thorough approach discussed and worth trying if you're facing similar issues.

Step 1: Enhance your theme.js for Instagram detection and scroll state

Again, head to Online Store → Themes → Edit Code → assets/theme.js. You'll want to add this entire block of code at the very bottom:

// Detect Instagram in-app browser
if (navigator.userAgent.includes(‘Instagram’)) {
document.documentElement.classList.add(‘instagram-browser’);
}

// Scroll state control
let isScrolling;

window.addEventListener(‘scroll’, () => {
document.documentElement.classList.add(‘is-scrolling’);

clearTimeout(isScrolling);

isScrolling = setTimeout(() => {
document.documentElement.classList.remove(‘is-scrolling’);
}, 250);
});

What's happening here? Besides detecting the Instagram browser, this code also adds a class is-scrolling to your HTML element while the user is actively scrolling. This is super clever because it allows you to pause animations only when scrolling is happening, which can prevent jankiness.

Step 2: Update your base.css for animation control and Instagram fixes

Next up, go to assets/base.css and paste this CSS at the bottom. This builds on the JavaScript by using those new classes:

/* Pause animations during active scroll */
.is-scrolling .scroll-trigger {
animation: none !important;
transition: none !important;
}

/* Instagram in-app browser fix */
.instagram-browser .scroll-trigger,
.instagram-browser .scroll-trigger.animate–slide-in,
.instagram-browser .scroll-trigger.animate–fade-in {
animation: none !important;
opacity: 1 !important;
transform: none !important;
}

/* Mobile-safe animation handling */

@media (max-width: 768px) {
.scroll-trigger {
transform: none !important;
will-change: auto !important;
}

.slider,
.slider-mobile-gutter {
scroll-snap-type: none !important;
}
}

This CSS does a few things: it pauses animations while scrolling (using that is-scrolling class), specifically targets and disables animations for the Instagram browser (similar to Mustafa_Ali's suggestion, but within a broader context), and includes some mobile-specific overrides to ensure smooth performance on smaller screens, even disabling scroll-snap for sliders if needed. The will-change: auto !important; is a subtle but powerful addition for performance.

Step 3: Check carousel initialization timing

This is a crucial, often overlooked step. Sometimes, scripts that initialize sliders or carousels (like those in your Featured Collections and Multicolumn sections) fire too early, before the page is fully ready, especially in finicky browsers. Wsp suggested checking your sections/featured-collection.liquid and sections/multicolumn.liquid files.

If you find that your slider/carousel scripts are initializing on DOMContentLoaded, you should move them to window.load instead. This ensures all assets (images, stylesheets, etc.) are fully loaded before the scripts try to manipulate them.

Here's what that change would look like:

window.addEventListener(‘load’, function () {
// slider initialization code here
});

Just be careful not to add random functions like initCarousels(); unless you know that function already exists in your theme's JavaScript.

Wrapping It Up

Dealing with browser-specific glitches, especially from in-app browsers like Instagram's, can be a real headache. They often have their own rendering engines or quirks that deviate from standard web browsers. The community's efforts in this thread really highlight the trial-and-error nature of these fixes. While HP92P didn't confirm a definitive win with the final, more extensive solution, these steps represent the most robust approach shared to tackle the Dawn theme's scroll animation issues on Instagram. Remember to always test thoroughly after making any code changes to your live theme, perhaps on a duplicate theme first! It's all about ensuring your customers have a seamless and enjoyable experience, no matter how they discover your store.

Share:

Use cases

Explore use cases

Agencies, store owners, enterprise — find the migration path that fits.

Explore use cases