this repo has no descr,ription vt3e.cat

feat: add SvgComponent; fix ImageComponent styles

vt3e.cat 7985014b 9b9f5580

verified
+38 -1
+1 -1
pkgs/web/src/components/ImageComponent.vue
··· 72 72 </template> 73 73 74 74 <style scoped> 75 - #img { 75 + img { 76 76 display: block; 77 77 max-width: 100%; 78 78 height: auto;
+37
pkgs/web/src/components/SvgComponent.vue
··· 1 + <script setup lang="ts"> 2 + const props = defineProps<{ 3 + icon: string 4 + title?: string 5 + decorative?: boolean 6 + }>() 7 + </script> 8 + 9 + <template> 10 + <div 11 + class="svg-container" 12 + v-html="icon" 13 + :role="props.decorative ? 'img' : 'img'" 14 + :aria-hidden="props.decorative ? 'true' : 'false'" 15 + :aria-label="props.decorative ? undefined : props.title" 16 + ></div> 17 + </template> 18 + 19 + <style scoped> 20 + .svg-container { 21 + display: inline-flex; 22 + align-items: center; 23 + justify-content: center; 24 + line-height: 0; 25 + 26 + width: 100%; 27 + height: 100%; 28 + } 29 + 30 + :deep(svg) { 31 + width: 100%; 32 + height: 100%; 33 + 34 + fill: currentColor; 35 + display: block; 36 + } 37 + </style>