docs/.vitepress/theme/components/Block.vue

e84cad03543124fad380dccb887c388dd146ab84
wotaku/docs/.vitepress/theme/components/Block.vue
taskylizard fix oopsie, format5b7264f968 1 year ago

57 lines · 1312 bytes

 1<!--
 2  All Rights Reserved
 3
 4  Copyright (c) 2025 taskylizard
 5
 6  All rights reserved. This code and its associated files may not be copied, modified, distributed, sublicensed, or used in any form, in whole or in part, without prior written permission from the copyright holder.
 7-->
 8<script setup lang="ts">
 9withDefaults(
10  defineProps<{
11    text?: string
12    type?: 'info' | 'tip' | 'warning' | 'danger'
13    link: string
14    icon?: string
15  }>(),
16  { icon: 'i-octicon-link-external-16', type: 'tip' }
17)
18</script>
19
20<template>
21  <component
22    :target="link ? '_blank' : undefined"
23    :is="link ? 'a' : 'span'"
24    :href="link"
25    :class="type"
26    class="VButton inline-flex items-center px4 py3 gap2 rounded-md align-middle cursor-pointer"
27  >
28    <div :class="icon" />
29    <slot>{{ text }}</slot>
30  </component>
31</template>
32
33<style scoped>
34.VButton {
35  text-decoration: none !important;
36}
37
38.VButton.info {
39  color: var(--vp-badge-info-text);
40  background-color: var(--vp-badge-info-bg);
41}
42
43.VButton.tip {
44  color: var(--vp-badge-tip-text);
45  background-color: var(--vp-badge-tip-bg);
46}
47
48.VButton.warning {
49  color: var(--vp-badge-warning-text);
50  background-color: var(--vp-badge-warning-bg);
51}
52
53.VButton.danger {
54  color: var(--vp-badge-danger-text);
55  background-color: var(--vp-badge-danger-bg);
56}
57</style>
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form