been dealing with that annoying flash of unstyled content when your ab test loads late. if you're using
google optimizely or any client-side tool that doesn't inject fast enough, the user sees the original button before it flips to the variant. i usually just hide the element via a small snippet in the head before the main script even fires.
never skip this part because it ruins the whole point of testing.
.test-variant-element {visibility: hidden;}it's way cleaner than dealing with layout shifts later on. you just swap it back to visible once your mutation observer or the tool's callback hits. anyone else still struggling with flicker on mobile?