Skip to content

Commit

Permalink
fix: optimize toc hover color states
Browse files Browse the repository at this point in the history
  • Loading branch information
CaliCastle committed Jun 18, 2023
1 parent d16d1b7 commit 5a2e971
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/(main)/blog/BlogPostTableOfContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,12 @@ export function BlogPostTableOfContents({ headings }: { headings: Node[] }) {
key={node.id}
variants={itemVariants}
className={clsxm(
'text-[12px] font-medium leading-[18px] transition-colors duration-300 hover:text-zinc-900 dark:hover:text-zinc-200 group-hover:[&:not(:hover)]:text-zinc-400 dark:group-hover:[&:not(:hover)]:text-zinc-600',
'text-[12px] font-medium leading-[18px] transition-colors duration-300',
node.style === 'h3' && 'ml-1',
node.style === 'h4' && 'ml-2',
node.id === highlightedHeadingId &&
'text-zinc-900 dark:text-zinc-200'
node.id === highlightedHeadingId
? 'text-zinc-900 dark:text-zinc-200'
: 'hover:text-zinc-700 dark:hover:text-zinc-400 group-hover:[&:not(:hover)]:text-zinc-400 dark:group-hover:[&:not(:hover)]:text-zinc-600'
)}
aria-label={node.id === highlightedHeadingId ? '当前位置' : undefined}
>
Expand Down

0 comments on commit 5a2e971

Please sign in to comment.