Signed-off-by: Yigit BALABAN <balaban@yigid.dev>
This commit is contained in:
commit
2cfe29f197
24 files changed
+4940
No files matched your search
@@ -0,0 +1,16 @@
|
||||
---
|
||||
// Inlined peacock mark. The original site fetched these SVGs at runtime and
|
||||
// swapped `fill:#...` for `fill:currentColor`; Astro can inline them at build
|
||||
// time instead, which produces the same DOM without a network round-trip.
|
||||
import headMark from '../assets/peacock-head.svg?raw';
|
||||
import fullMark from '../assets/peacock-full.svg?raw';
|
||||
|
||||
const { name = 'head' } = Astro.props;
|
||||
const source = name === 'full' ? fullMark : headMark;
|
||||
const markup = source
|
||||
.replace(/<\?xml[^>]*\?>/g, '')
|
||||
.replace(/fill:#[0-9a-fA-F]{3,8}/g, 'fill:currentColor')
|
||||
.trim();
|
||||
---
|
||||
|
||||
<Fragment set:html={markup} />
|
||||
Reference in new issue
Block a user