glyph.svelte (629B)
1 <script lang="ts"> 2 import { GLYPH_STYLE_MAP } from "$lib/styles/glyphs"; 3 import type { IGlyph } from "$lib/types/components"; 4 import { fmt_cl } from "$lib/utils/app"; 5 6 let { basis }: { basis: IGlyph } = $props(); 7 8 const styles = $derived( 9 basis?.dim ? GLYPH_STYLE_MAP.get(basis.dim) : GLYPH_STYLE_MAP.get(`sm`), 10 ); 11 12 const weight = $derived(basis.weight ? `-${basis.weight}` : `-bold`); 13 </script> 14 15 <div 16 id={basis.id || null} 17 class={`${fmt_cl(basis.classes)} flex flex-row text-[${styles?.gl_1}px] justify-center items-center`} 18 > 19 <i class={`ph${weight} ph-${basis.key}`}></i> 20 </div>