Follow

So this is interesting, in order to get an SVG background image on a dynamically-generated element to preload, the only way that I‘ve been able to find that works is to create literally the same element and add it to the DOM first.

Things that didn’t work:

* Making an SVG sprite sheet and adding that to the DOM
* Inlining the SVG as data
* Preloading via JS (new Image() //etc.)
* Preloading the images via link rel="preload"

· · Web · 2 · 1 · 3

@aral Huh. Do Chrome and Firefox behave the same on this one? It feels like this could be implementation-dependent.

@tsturm Yeah, seemed to be cross-platform/cross-browser/cross-rendering engine behaviour.

@aral Browser engines always agree with each other when their behavior is inconvenient to web developers. 😅

@aral Thanks for yet another reminder that computers don’t work and all software is terrible!

That might read as though I’m being sarcastic. I’m not.

Sign in to participate in the conversation
Aral’s Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!