docs: fix carbon

This commit is contained in:
zernonia 2024-10-16 14:11:36 +08:00
parent f5b02256bc
commit a01a1bd94d
3 changed files with 9 additions and 5 deletions

View File

@ -50,7 +50,7 @@ if (carbonOptions) {
<style scoped>
.carbon-ads {
@apply !mt-6 w-full flex justify-center items-center p-2 rounded-xl min-h-[256px] text-center leading-[18px] text-xs font-medium bg-card/50 border border-muted;
@apply !mt-8 w-[238px] flex justify-center items-center p-2 rounded-xl min-h-[256px] text-center leading-[18px] text-xs font-medium bg-card border border-muted;
}
.carbon-ads :deep(img) {

View File

@ -8,6 +8,10 @@ import { shallowRef } from 'vue'
import CarbonAds from '../components/CarbonAds.vue'
import TableOfContentTree from './TableOfContentTree.vue'
defineProps<{
showCarbonAds?: boolean
}>()
const headers = shallowRef<TableOfContents>()
function getHeadingsWithHierarchy(divId: string) {
@ -64,7 +68,7 @@ onContentUpdated(() => {
On This Page
</p>
<TableOfContentTree :tree="headers" :level="1" />
<CarbonAds />
<CarbonAds v-if="showCarbonAds" />
</div>
</ScrollArea>
</div>

View File

@ -5,7 +5,7 @@ import RadixIconsExternalLink from '~icons/radix-icons/external-link'
import { useData, useRoute } from 'vitepress'
import DocsBreadcrumb from '../components/DocsBreadcrumb.vue'
import EditLink from '../components/EditLink.vue'
import TableOfContentVue from '../components/TableOfContent.vue'
import TableOfContent from '../components/TableOfContent.vue'
import { docsConfig } from '../config/docs'
const $route = useRoute()
@ -62,7 +62,7 @@ const sourceLink = 'https://github.com/radix-vue/shadcn-vue/tree/dev/'
<main class="relative py-6 lg:gap-10 lg:py-8 xl:grid xl:grid-cols-[1fr_300px]">
<div class="mx-auto w-full min-w-0">
<div class="block xl:hidden">
<TableOfContentVue />
<TableOfContent />
</div>
<DocsBreadcrumb class="mb-4" />
@ -104,7 +104,7 @@ const sourceLink = 'https://github.com/radix-vue/shadcn-vue/tree/dev/'
<div class="hidden text-sm xl:block">
<div class="sticky top-16 -mt-10 h-[calc(100vh-3.5rem)] overflow-hidden pt-6">
<TableOfContentVue />
<TableOfContent show-carbon-ads />
</div>
</div>
</main>