Repository navigation
feat(playground): make named-layouts visually easier to identify #296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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> | ||
| ); | ||
| } |
| 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> | ||
| ); | ||
| } |
| 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', | ||
| fontWeight: 700, | ||
| textAlign: 'center', | ||
| }} | ||
| > | ||
| Docs | ||
| </header> | ||
| <main style={{ padding: 16 }}>{children}</main> | ||
| </div> | ||
| ); | ||
| } | ||
| 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> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
On Useful? React with 👍 / 👎. |
||
| </div> | ||
| ); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On
/docs, the default 16px white label against#FFCE1Bhas 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 👍 / 👎.