github.com/Theta-Dev/Talon@v0.0.0-20211018130634-ff179e19fa9a/ui/menu/src/components/InlineIcon.svelte (about) 1 <script lang="ts"> 2 import icons from "../util/icons" 3 4 export let iconName: string 5 export let color = "#fff" 6 export let size = 24 7 8 let icon: [number, number, string] 9 $: icon = icons[iconName] ?? [0, 0, ""] 10 11 </script> 12 13 <style lang="sass"> 14 @use "../style/values" 15 16 span 17 display: inline-block 18 </style> 19 20 <span class="icon"> 21 <svg 22 aria-hidden="true" 23 focusable="false" 24 role="img" 25 xmlns="http://www.w3.org/2000/svg" 26 width={size} 27 height={size} 28 viewBox="0 0 {icon[0]} {icon[1]}"> 29 <path d={icon[2]} fill={color} /> 30 </svg> 31 </span>