finish footer links
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
---
|
||||
export interface Props {
|
||||
name: string,
|
||||
width?: string,
|
||||
height?: string,
|
||||
};
|
||||
|
||||
const { name } = Astro.props;
|
||||
const { name, width, height } = Astro.props;
|
||||
|
||||
const icons = import.meta.glob<{string: string}>('@components/icons/*.svg', { query: '?raw', import: 'default' });
|
||||
const path = `/src/components/icons/${name}.svg`;
|
||||
@@ -13,11 +15,11 @@ if (icons[path] === undefined) {
|
||||
const icon = await icons[path]();
|
||||
---
|
||||
|
||||
<Fragment set:html={icon} />
|
||||
<span class="icon" set:html={icon} />
|
||||
|
||||
<style>
|
||||
svg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
<style define:vars={{ width, height }}>
|
||||
.icon :global(svg) {
|
||||
width: var(--width, 100%);
|
||||
height: var(--height, 100%);
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user