feat: improved ToC highlighting

This commit is contained in:
enscribe 2024-09-13 17:45:18 -07:00
parent b93eddea6b
commit c2fa587935
No known key found for this signature in database
GPG key ID: 9BBD5C4114E25322
16 changed files with 636 additions and 115 deletions

View file

@ -7,7 +7,7 @@ const Card = React.forwardRef<
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn('bg-background rounded-xl border', className)}
className={cn('rounded-xl border bg-background', className)}
{...props}
/>
))

View file

@ -23,13 +23,15 @@ export function ModeToggle() {
theme === 'dark' ||
(theme === 'system' &&
window.matchMedia('(prefers-color-scheme: dark)').matches)
document.documentElement.classList.add('disable-transitions')
document.documentElement.classList[isDark ? 'add' : 'remove']('dark')
window.getComputedStyle(document.documentElement).getPropertyValue('opacity')
window
.getComputedStyle(document.documentElement)
.getPropertyValue('opacity')
requestAnimationFrame(() => {
document.documentElement.classList.remove('disable-transitions')
})
@ -65,4 +67,4 @@ export function ModeToggle() {
</DropdownMenuContent>
</DropdownMenu>
)
}
}