Global SVG Icons Component
Original SVG file.
- Rename
svg
tag to symbol
- Remove
xmlns='http://www.w3.org/2000/svg'
- add unique id.
id="close-icon"
Add to svg
tag in a hidden <div>
Import the file into the footer component to make it accessible on every page. Or you could put it in the Layouts.astro file.
Using the icon
- add
height
and width
that is the same aspect ratio as original
Destructuring Class in a Child Component
Astro Styling Docs.
---
const { class: className, ...rest } = Astro.props;
---
<div class={className} {...rest}>
<slot/>
</div>