tangled
alpha
login
or
join now
vt3e.cat
/
www
2
fork
atom
this repo has no descr,ription
vt3e.cat
2
fork
atom
overview
issues
pulls
pipelines
feat: add SvgComponent; fix ImageComponent styles
vt3e.cat
2 months ago
7985014b
9b9f5580
verified
This commit was signed with the committer's
known signature
.
vt3e.cat
SSH Key Fingerprint:
SHA256:bC12nO0d6wKnJ426YBbLO7LVxmZlwJ1l2X0eqOroDV0=
+38
-1
2 changed files
expand all
collapse all
unified
split
pkgs
web
src
components
ImageComponent.vue
SvgComponent.vue
+1
-1
pkgs/web/src/components/ImageComponent.vue
···
72
72
</template>
73
73
74
74
<style scoped>
75
75
-
#img {
75
75
+
img {
76
76
display: block;
77
77
max-width: 100%;
78
78
height: auto;
+37
pkgs/web/src/components/SvgComponent.vue
···
1
1
+
<script setup lang="ts">
2
2
+
const props = defineProps<{
3
3
+
icon: string
4
4
+
title?: string
5
5
+
decorative?: boolean
6
6
+
}>()
7
7
+
</script>
8
8
+
9
9
+
<template>
10
10
+
<div
11
11
+
class="svg-container"
12
12
+
v-html="icon"
13
13
+
:role="props.decorative ? 'img' : 'img'"
14
14
+
:aria-hidden="props.decorative ? 'true' : 'false'"
15
15
+
:aria-label="props.decorative ? undefined : props.title"
16
16
+
></div>
17
17
+
</template>
18
18
+
19
19
+
<style scoped>
20
20
+
.svg-container {
21
21
+
display: inline-flex;
22
22
+
align-items: center;
23
23
+
justify-content: center;
24
24
+
line-height: 0;
25
25
+
26
26
+
width: 100%;
27
27
+
height: 100%;
28
28
+
}
29
29
+
30
30
+
:deep(svg) {
31
31
+
width: 100%;
32
32
+
height: 100%;
33
33
+
34
34
+
fill: currentColor;
35
35
+
display: block;
36
36
+
}
37
37
+
</style>