Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion playground/named-layouts/pages/_layouts/landing.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
export default function LandingLayout({ children }: { children: React.ReactNode }) {
return <div data-layout="landing">{children}</div>;
return (
<div data-layout="landing" style={{ minHeight: '100vh', margin: -8 }}>
<header
style={{
boxSizing: 'border-box',
width: '100%',
padding: '16px 24px',
background: '#305CDE',
color: '#ffffff',
fontWeight: 700,
textAlign: 'center',
}}
>
Landing
</header>
<main style={{ padding: 16 }}>{children}</main>
</div>
);
}
19 changes: 18 additions & 1 deletion playground/named-layouts/pages/docs/_layouts/api.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
export default function ApiLayout({ children }: { children: React.ReactNode }) {
return <div data-layout="api">{children}</div>;
return (
<div data-layout="api" style={{ minHeight: '100vh', margin: -8 }}>
<header
style={{
boxSizing: 'border-box',
width: '100%',
padding: '16px 24px',
background: '#006400',
color: '#ffffff',
fontWeight: 700,
textAlign: 'center',
}}
>
API
</header>
<main style={{ padding: 16 }}>{children}</main>
</div>
);
}
19 changes: 18 additions & 1 deletion playground/named-layouts/pages/docs/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
export default function DocsLayout({ children }: { children: React.ReactNode }) {
return <div data-layout="docs">{children}</div>;
return (
<div data-layout="docs" style={{ minHeight: '100vh', margin: -8 }}>
<header
style={{
boxSizing: 'border-box',
width: '100%',
padding: '16px 24px',
background: '#FFCE1B',
color: '#ffffff',
Comment on lines +9 to +10

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Increase the Docs header contrast

On /docs, the default 16px white label against #FFCE1B has a contrast ratio of approximately 1.49:1, far below the 4.5:1 threshold for normal-sized text. This makes the newly added layout identifier difficult to read for low-vision users and undermines the purpose of making layouts visually distinguishable; use substantially darker text or a darker background.

Useful? React with 👍 / 👎.

fontWeight: 700,
textAlign: 'center',
}}
>
Docs
</header>
<main style={{ padding: 16 }}>{children}</main>
</div>
);
}
19 changes: 18 additions & 1 deletion playground/named-layouts/pages/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
export default function RootLayout({ children }: { children: React.ReactNode }) {
return <div data-layout="root">{children}</div>;
return (
<div data-layout="root" style={{ minHeight: '100vh', margin: -8 }}>
<header
style={{
boxSizing: 'border-box',
width: '100%',
padding: '16px 24px',
background: '#dc2626',
color: '#ffffff',
fontWeight: 700,
textAlign: 'center',
}}
>
Layout
</header>
<main style={{ padding: 16 }}>{children}</main>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep composed layouts from nesting <main>

On /docs and /docs/ref, the integration routes compose this root layout with the Docs or API layout, each of which now adds another <main>. The resulting visible, nested main landmarks are invalid HTML and make landmark navigation ambiguous for screen-reader users; use a neutral wrapper for layout content or reserve <main> for only one level.

Useful? React with 👍 / 👎.

</div>
);
}