Skip to content

πŸ“š The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

Make icons reactives

Smaug67394352cdcf8d55
diff --git a/frontend/app/components/Icon.vue b/frontend/app/components/Icon.vue
index 129b9924..807b3ed9 100644
--- a/frontend/app/components/Icon.vue
+++ b/frontend/app/components/Icon.vue
@@ -1,11 +1,11 @@
<template>
- <i v-html="icon" class="icon" :style="{ fill }" :class="{ fill, big, mid }"></i>
+ <i v-html="icon" class="icon" :style="{ fill }" :class="{ fill, big, mid, small }"></i>
</template>
<script setup lang="ts">
import { useIcon, type IconName } from '~/helpers/icons';
-const props = defineProps<{ name: IconName | string; fill?: string; big?: true; mid?: boolean }>();
-const icon = useIcon(props.name as IconName) || props.name;
+const props = defineProps<{ name: IconName | string; fill?: string; big?: true; mid?: boolean; small?: boolean }>();
+const icon = computed(() => useIcon(props.name as IconName) || props.name);
</script>
<style scoped lang="scss">
@@ -25,6 +25,12 @@ const icon = useIcon(props.name as IconName) || props.name;
.fill:deep(svg) > path {
fill: inherit !important;
}
+.small {
+ &:deep(svg) {
+ width: 18px;
+ max-height: 18px;
+ }
+}
.mid {
&:deep(svg) {
width: 21px;