yunohost-portal/components/PageTitle.vue

37 lines
630 B
Vue
Raw Normal View History

2023-08-06 16:27:24 +02:00
<script setup lang="ts">
2023-11-14 19:17:04 +01:00
withDefaults(
defineProps<{
tag?: string
text?: string
srOnly?: boolean
}>(),
{
tag: 'h1',
text: undefined,
srOnly: false,
},
)
2023-08-06 16:27:24 +02:00
</script>
<template>
<component
:is="tag"
id="main-target"
tabindex="-1"
class="inline-block text-4xl font-bold"
:class="{ 'sr-only focus:not-sr-only': srOnly }"
>
2023-08-06 16:27:24 +02:00
<slot name="default">
{{ text }}
</slot>
</component>
2023-08-06 16:27:24 +02:00
</template>
<style scoped>
#main-target {
/* Need some override here because of `not-sr-only` styles */
margin-top: 2rem !important;
margin-bottom: 0.75rem !important;
}
</style>