feat: 样式优化

This commit is contained in:
KazooTTT
2024-10-11 12:47:30 +08:00
parent 1fe5b60395
commit 878e16ceb2
2 changed files with 16 additions and 9 deletions

View File

@ -75,8 +75,8 @@ const dateTimeOptions: Intl.DateTimeFormatOptions = {
<path d='M17.573 18.407l2.834 -2.834a2.025 2.025 0 0 0 0 -2.864l-7.117 -7.116' /> <path d='M17.573 18.407l2.834 -2.834a2.025 2.025 0 0 0 0 -2.864l-7.117 -7.116' />
<path d='M6 9h-.01' /> <path d='M6 9h-.01' />
</svg> </svg>
{data.tags.map((tag, i) => ( <div class='space-x-1'>
<div> {data.tags.map((tag, i) => (
<a <a
aria-label={`View more blogs with the tag ${tag}`} aria-label={`View more blogs with the tag ${tag}`}
class="inline-block before:content-['#'] hover:underline hover:underline-offset-4" class="inline-block before:content-['#'] hover:underline hover:underline-offset-4"
@ -85,9 +85,8 @@ const dateTimeOptions: Intl.DateTimeFormatOptions = {
> >
{tag} {tag}
</a> </a>
{i < data.tags.length - 1 && ', '} ))}
</div> </div>
))}
</div> </div>
) )
} }

View File

@ -14,8 +14,16 @@ const toc = generateToc(headings)
--- ---
<aside class='sticky top-20 order-2 -me-28 hidden basis-60 lg:flex lg:flex-col'> <aside class='sticky top-20 order-2 -me-28 hidden basis-60 lg:flex lg:flex-col'>
<h2 class='font-semibold'>TABLE OF CONTENTS</h2> {
<ul class='text-card-foreground'> toc.length > 0 && (
{toc.map((heading) => <TOCHeading heading={heading} />)} <>
</ul> <h2 class='font-semibold'>TABLE OF CONTENTS</h2>
<ul class='text-card-foreground'>
{toc.map((heading) => (
<TOCHeading heading={heading} />
))}
</ul>
</>
)
}
</aside> </aside>