Fixing iPhone Safari Canvas Memory Failures in Scroll-Driven SkiesFixing iPhone Safari Canvas Memory Failures in Scroll-Driven Skies
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
iPhone Safari left our sky stuck at night
We built a concept where scroll is the time of day. The sky was a canvas. Fine on our laptops. On an iPhone, you could scroll to noon and the sky would stay dark.
iOS Safari caps total canvas memory at around 224 MB on many iPhones. Past that, new or resized canvases fail silently — they don't throw, they just draw nothing. We were minting hundreds of offscreen canvases for cached sprites in one scroll. The sky was the first thing to go.
So we never let the base color depend on a canvas. The sky is now a CSS gradient, set in plain hex, with a daytime fallback in the stylesheet. Canvases are only for extras, and we cap them at 48. We ignore the resize events iOS fires when the toolbar shows and hides, and we test every build in WebKit.
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started