natemoo-re / astro-icon

Inline and sprite-based SVGs in Astro made easy!
https://astroicon.dev
Other
990 stars 57 forks source link

Automatically optimized sprites #223

Open J-env opened 1 month ago

J-env commented 1 month ago

What version of astro-icon are you using?

4.8.5

Astro Info

Astro                    v4.8.4
Node                     v18.18.0
System                   macOS (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             @astrojs/vue

If this issue only occurs in one browser, which browser is a problem?

Chrome

Describe the Bug

If the first svg <symbol /> sprite is hidden, subsequent svg <use /> will not be displayed.

// 
<div class="parent" style="display: none;">
  // first time
  <Icon name="logo" />
</div>

// Cannot be displayed here
<Icon name="logo" />

// ...

What's the expected result?

This should be a problem with svg rendering itself.

Link to Minimal Reproducible Example

none