A quick update - it occurred to us that, probably in conjunction with a lack of caching, an issue with flickering might arise from there being ~1000 symbols in the sprite - symbols are shadow DOM elements, so vast numbers of them would take time for the browser to process. But we tested showing symbols directly from solid.svg (once mapped to currentColor) in a local Showcase and we still see no flickering.
If you only saw the flickering when using .svgIcon (ie, when setting SVG fill directly, rather than CSS color), there's a vague possibility that using CSS to set SVG attributes directly, rather than just CSS color, might behave differently enough that it can cause a flicker - we don't see that in testing or in the Showcase samples, though, so it seems unlikely.
In the meantime - we've added a new class, .icon, which sets CSS color, rather than SVG fill and stroke - you should see that in tomorrow's builds, dated March 30 and later.
[EDIT]
Note that, on further testing, we find that if your setup is not configured to cache SVG, then a sprite with hundreds of symbols may indeed cause flickering when applying stateful modifications to individual symbols, as a result of the browser re-loading and processing the entire sprite.
The solution is to ensure that image/svg+xml is cacheable.
If you only saw the flickering when using .svgIcon (ie, when setting SVG fill directly, rather than CSS color), there's a vague possibility that using CSS to set SVG attributes directly, rather than just CSS color, might behave differently enough that it can cause a flicker - we don't see that in testing or in the Showcase samples, though, so it seems unlikely.
In the meantime - we've added a new class, .icon, which sets CSS color, rather than SVG fill and stroke - you should see that in tomorrow's builds, dated March 30 and later.
[EDIT]
Note that, on further testing, we find that if your setup is not configured to cache SVG, then a sprite with hundreds of symbols may indeed cause flickering when applying stateful modifications to individual symbols, as a result of the browser re-loading and processing the entire sprite.
The solution is to ensure that image/svg+xml is cacheable.
Comment