修改H1-H6和表格,strong字体
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
<template>
|
||||
<h1
|
||||
:id
|
||||
class="scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl"
|
||||
:class="['scroll-m-20 font-extrabold tracking-tight', themeSizeClass]"
|
||||
:style="themeTextShadowStyle"
|
||||
>
|
||||
<NuxtLink
|
||||
v-if="generate"
|
||||
@@ -18,4 +19,26 @@ const { id } = defineProps<{ id?: string }>()
|
||||
|
||||
const { headings } = useRuntimeConfig().public.mdc
|
||||
const generate = computed(() => id && ((typeof headings?.anchorLinks === 'boolean' && headings?.anchorLinks === true) || (typeof headings?.anchorLinks === 'object' && headings?.anchorLinks?.h1)))
|
||||
|
||||
// 读取主题,按主题做轻量风格差异:
|
||||
// - classic: 无阴影,正常字号
|
||||
// - elegant: 有文字阴影,正常字号
|
||||
// - minimal: 无阴影,较小字号
|
||||
const { selectedTheme } = useTheme()
|
||||
|
||||
// 这个计算属性 themeSizeClass 用于根据当前主题(selectedTheme)动态设置 h1 标题的字号样式:
|
||||
// - 如果主题是 minimal,则使用较小字号 'text-2xl lg:text-3xl'
|
||||
// - 否则(classic 或 elegant),使用较大字号 'text-3xl lg:text-4xl'
|
||||
const themeSizeClass = computed(() => {
|
||||
return selectedTheme.value === 'classic'
|
||||
? 'text-2xl lg:text-3xl border-b border-gray-200 dark:border-gray-700'
|
||||
: 'text-3xl lg:text-4xl'
|
||||
})
|
||||
|
||||
const themeTextShadowStyle = computed(() => {
|
||||
if (selectedTheme.value === 'elegant') {
|
||||
return { textShadow: '0 2px 8px rgba(0,0,0,0.15)' }
|
||||
}
|
||||
return { textShadow: 'none' }
|
||||
})
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user