add custom headings with deep link

This commit is contained in:
2026-04-04 14:58:59 -04:00
parent 68bb25357b
commit 675ef1003d
11 changed files with 145 additions and 37 deletions

View File

@@ -3,9 +3,10 @@ export interface Props {
name: string,
width?: string,
height?: string,
display?: string,
};
const { name, width, height } = Astro.props;
const { name, width, height, display } = Astro.props;
const icons = import.meta.glob<{string: string}>('@components/icons/*.svg', { query: '?raw', import: 'default' });
const path = `/src/components/icons/${name}.svg`;
@@ -17,8 +18,9 @@ const icon = await icons[path]();
<span class="icon" set:html={icon} />
<style define:vars={{ width, height }}>
<style define:vars={{ width, height, display }}>
.icon :global(svg) {
display: var(--display, block);
width: var(--width, 100%);
height: var(--height, 100%);
}