Skip to content

Commit f9eacd6

Browse files
committed
fix: semantic tags
1 parent ce3d2c9 commit f9eacd6

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/app/[...slug]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ export default async function Page({ params }: Props) {
3737

3838
return (
3939
<>
40-
<div className={cn('mb-6 mt-8 border-b', 'border-outline-variant/50')}>
40+
<header className={cn('mb-6 mt-8 border-b', 'border-outline-variant/50')}>
4141
<h1 className="mb-2 text-5xl font-bold tracking-tighter">{doc.title}</h1>
4242
{!!doc?.description?.length && (
4343
<p className={cn('my-2 text-base leading-5', 'text-on-surface-variant/50')}>
4444
{doc.description}
4545
</p>
4646
)}
47-
</div>
47+
</header>
4848
{doc ? <>{doc.content}</> : 'empty doc'}
4949
</>
5050
)

src/components/mdx/Intro/Intro.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
import cn from '@/lib/cn'
2+
import { VisuallyHidden } from '@radix-ui/react-visually-hidden'
23
import { ComponentProps } from 'react'
34

4-
export function Intro({ className, ...props }: ComponentProps<'div'>) {
5-
return <div {...props} className={cn(className, 'my-6 text-xl leading-relaxed')} />
5+
export function Intro({ children, className, ...props }: ComponentProps<'div'>) {
6+
return (
7+
<section {...props} className={cn(className, 'my-6 text-xl leading-relaxed')}>
8+
<VisuallyHidden>
9+
<h2>Summary</h2>
10+
</VisuallyHidden>
11+
{children}
12+
</section>
13+
)
614
}

0 commit comments

Comments
 (0)