From adfafdc1263f9498e98c87378207715b4447917c Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 25 Dec 2025 18:16:14 +0000 Subject: [PATCH] feat: apply docs page styling to match ui-mockup-01 - Created docs.css with exact mockup specifications * Typography: H1 42px, H2 30px, H3 24px with proper spacing * Content padding: 48px 64px * 3-column grid: 280px sidebar + max 900px content + 240px TOC * Responsive breakpoints at 1200px and 768px - Updated docs layout to import docs.css and wrap content - Refactored page.tsx to use semantic CSS classes * docs-main-layout for 3-column grid * docs-content for main content area * docs-content-meta for metadata section - Updated all components to use CSS classes: * Sidebar: docs-sidebar, sidebar-section, sidebar-title, sidebar-link * TableOfContents: docs-toc, toc-title, toc-nav, toc-link * Breadcrumbs: docs-breadcrumbs, breadcrumb-link, breadcrumb-separator * NavigationFooter: nav-footer, nav-card, nav-card-label, nav-card-title - Removed inline styles in favor of centralized CSS - Build verified successful --- next-env.d.ts | 2 +- src/app/docs/[...slug]/page.tsx | 49 ++-- src/app/docs/docs.css | 422 ++++++++++++++++++++++++++++ src/app/docs/layout.tsx | 5 +- src/components/Breadcrumbs.tsx | 6 +- src/components/NavigationFooter.tsx | 16 +- src/components/Sidebar.tsx | 52 +--- src/components/TableOfContents.tsx | 22 +- 8 files changed, 470 insertions(+), 104 deletions(-) create mode 100644 src/app/docs/docs.css diff --git a/next-env.d.ts b/next-env.d.ts index c4b7818..9edff1c 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -1,6 +1,6 @@ /// /// -import "./.next/dev/types/routes.d.ts"; +import "./.next/types/routes.d.ts"; // NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/src/app/docs/[...slug]/page.tsx b/src/app/docs/[...slug]/page.tsx index 33c8aac..9cdcc82 100644 --- a/src/app/docs/[...slug]/page.tsx +++ b/src/app/docs/[...slug]/page.tsx @@ -73,31 +73,28 @@ export default async function DocPage({ params }: PageProps) { } return ( -
+ <> {/* Mobile Navigation Drawer */} {/* 3-Column Layout: Sidebar + Content + TOC */} - {/* Desktop (>1200px): 3 columns, Tablet (768-1200px): 2 columns, Mobile (<768px): 1 column */} -
+
{/* Sidebar Navigation - Hidden on mobile */} {/* Main Content */} -
+
-

- {frontmatter.title} -

+

{frontmatter.title}

{/* Reading Metadata */} -
-
+
+
📖 {readingTime} min read
-
+
📅 Last updated: {new Date(lastModified).toLocaleDateString('en-US', { @@ -108,7 +105,7 @@ export default async function DocPage({ params }: PageProps) {
{frontmatter.author && ( -
+
👤 {frontmatter.author}
@@ -141,18 +138,16 @@ export default async function DocPage({ params }: PageProps) { }, // Skip markdown h1 to avoid duplicate with page title h1: () => null, - h2: ({ node, ...props }: any) =>

, - h3: ({ node, ...props }: any) =>

, - h4: ({ node, ...props }: any) =>

, - h5: ({ node, ...props }: any) =>

, - h6: ({ node, ...props }: any) =>
, - p: ({ node, ...props }: any) =>

, - ul: ({ node, ...props }: any) =>

{/* Table of Contents - Hidden below 1200px to match mockup */} - {toc.length > 0 && ( - - )} + {toc.length > 0 && }
-
+ ); } diff --git a/src/app/docs/docs.css b/src/app/docs/docs.css new file mode 100644 index 0000000..5ecd3fe --- /dev/null +++ b/src/app/docs/docs.css @@ -0,0 +1,422 @@ +/* EmberDocs Documentation Pages - Matching ui-mockup-01-documentation-page.html */ + +/* Ensure docs pages use the correct color scheme */ +.docs-layout { + background: var(--bg); + color: var(--text); + min-height: 100vh; +} + +/* Sidebar Styling - Exact mockup match */ +.docs-sidebar { + background: var(--surface); + border-right: 1px solid var(--border); + padding: 24px 0; + overflow-y: auto; + height: calc(100vh - 64px); + position: sticky; + top: 64px; + width: 280px; +} + +.sidebar-section { + margin-bottom: 24px; +} + +.sidebar-title { + font-size: 12px; + font-weight: 600; + color: var(--text-tertiary); + text-transform: uppercase; + letter-spacing: 0.05em; + padding: 0 24px; + margin-bottom: 8px; +} + +.sidebar-link { + display: block; + padding: 8px 24px; + color: var(--text-secondary); + text-decoration: none; + font-size: 14px; + transition: all 0.2s; + border-left: 2px solid transparent; +} + +.sidebar-link:hover { + color: var(--text); + background: rgba(139, 92, 246, 0.1); +} + +.sidebar-link.active { + color: var(--purple); + background: rgba(139, 92, 246, 0.1); + border-left-color: var(--purple); + font-weight: 500; +} + +.sidebar-link.nested { + padding-left: 40px; + font-size: 13px; +} + +/* Content Area - Exact mockup match */ +.docs-content { + padding: 48px 64px; + max-width: 900px; +} + +@media (max-width: 768px) { + .docs-content { + padding: 24px !important; + } +} + +/* Breadcrumbs */ +.docs-breadcrumbs { + display: flex; + align-items: center; + gap: 8px; + font-size: 14px; + color: var(--text-tertiary); + margin-bottom: 32px; +} + +.breadcrumb-link { + color: var(--text-tertiary); + text-decoration: none; + transition: color 0.2s; +} + +.breadcrumb-link:hover { + color: var(--purple); +} + +.breadcrumb-separator { + color: var(--border); +} + +/* Typography - Exact mockup match */ +.docs-content h1 { + font-size: 42px; + font-weight: 700; + line-height: 1.2; + letter-spacing: -0.02em; + margin-bottom: 16px; + color: var(--text); +} + +.docs-content-meta { + display: flex; + gap: 24px; + margin-bottom: 32px; + padding-bottom: 32px; + border-bottom: 1px solid var(--border); +} + +.meta-item { + display: flex; + align-items: center; + gap: 6px; + font-size: 14px; + color: var(--text-tertiary); +} + +.docs-content h2 { + font-size: 30px; + font-weight: 700; + margin-top: 48px; + margin-bottom: 16px; + color: var(--text); + letter-spacing: -0.02em; + line-height: 1.2; +} + +.docs-content h3 { + font-size: 24px; + font-weight: 600; + margin-top: 32px; + margin-bottom: 12px; + color: var(--text); + letter-spacing: -0.02em; + line-height: 1.2; +} + +.docs-content h4 { + font-size: 20px; + font-weight: 600; + margin-top: 24px; + margin-bottom: 8px; + color: var(--text); +} + +.docs-content h5 { + font-size: 18px; + font-weight: 600; + margin-top: 20px; + margin-bottom: 8px; + color: var(--text); +} + +.docs-content h6 { + font-size: 16px; + font-weight: 600; + margin-top: 16px; + margin-bottom: 8px; + color: var(--text); +} + +.docs-content p { + margin-bottom: 16px; + color: var(--text-secondary); + line-height: 1.7; + font-size: 16px; +} + +.docs-content ul, +.docs-content ol { + margin-bottom: 16px; + padding-left: 24px; + color: var(--text-secondary); +} + +.docs-content li { + margin-bottom: 8px; + line-height: 1.7; +} + +.docs-content a { + color: var(--purple); + text-decoration: none; + transition: color 0.2s; +} + +.docs-content a:hover { + text-decoration: underline; +} + +/* Inline Code */ +.docs-content code { + background: var(--code-bg); + border: 1px solid var(--border); + border-radius: 4px; + padding: 2px 6px; + font-family: 'JetBrains Mono', monospace; + font-size: 14px; + color: var(--amber); +} + +/* Code blocks - already styled by CodeBlock.tsx but ensuring consistency */ +.docs-content pre code { + background: transparent; + border: none; + padding: 0; + color: inherit; +} + +/* Table of Contents */ +.docs-toc { + padding: 48px 24px; + height: calc(100vh - 64px); + position: sticky; + top: 64px; + overflow-y: auto; + width: 240px; +} + +.toc-title { + font-size: 12px; + font-weight: 600; + color: var(--text-tertiary); + text-transform: uppercase; + letter-spacing: 0.05em; + margin-bottom: 12px; +} + +.toc-nav { + list-style: none; + margin: 0; + padding: 0; +} + +.toc-nav li { + margin-bottom: 8px; +} + +.toc-link { + display: block; + color: var(--text-tertiary); + text-decoration: none; + font-size: 13px; + transition: color 0.2s; + line-height: 1.4; +} + +.toc-link:hover { + color: var(--purple); +} + +.toc-link.active { + color: var(--purple); + font-weight: 500; +} + +.toc-link.level-2 { + padding-left: 12px; +} + +.toc-link.level-3 { + padding-left: 24px; + font-size: 12px; +} + +/* Main Layout Grid */ +.docs-main-layout { + display: grid; + grid-template-columns: 280px 1fr 240px; + max-width: 1920px; + margin: 0 auto; + min-height: calc(100vh - 64px); +} + +/* Responsive breakpoints matching mockup */ +@media (max-width: 1200px) { + .docs-main-layout { + grid-template-columns: 280px 1fr; + } + + .docs-toc { + display: none; + } +} + +@media (max-width: 768px) { + .docs-main-layout { + grid-template-columns: 1fr; + } + + .docs-sidebar { + display: none; + } +} + +/* Navigation Footer */ +.nav-footer { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 16px; + margin-top: 64px; + padding-top: 32px; + border-top: 1px solid var(--border); +} + +.nav-card { + background: var(--surface); + border: 1px solid var(--border); + border-radius: 8px; + padding: 20px; + text-decoration: none; + transition: all 0.2s; + display: flex; + flex-direction: column; + gap: 8px; +} + +.nav-card:hover { + border-color: var(--purple); + background: var(--surface-hover); + transform: translateY(-2px); + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); +} + +.nav-card-label { + font-size: 12px; + color: var(--text-tertiary); + text-transform: uppercase; + letter-spacing: 0.05em; + font-weight: 600; +} + +.nav-card-title { + font-size: 16px; + color: var(--text); + font-weight: 500; +} + +.nav-card.prev { + text-align: left; +} + +.nav-card.next { + text-align: right; +} + +@media (max-width: 640px) { + .nav-footer { + grid-template-columns: 1fr; + } +} + +/* Callout boxes (for tips, warnings, etc.) */ +.callout { + background: rgba(139, 92, 246, 0.1); + border-left: 3px solid var(--purple); + padding: 16px; + margin: 24px 0; + border-radius: 4px; +} + +.callout-title { + font-weight: 600; + color: var(--purple); + margin-bottom: 8px; +} + +.callout.warning { + background: rgba(245, 158, 11, 0.1); + border-left-color: var(--amber); +} + +.callout.warning .callout-title { + color: var(--amber); +} + +.callout.error { + background: rgba(239, 68, 68, 0.1); + border-left-color: var(--error); +} + +.callout.error .callout-title { + color: var(--error); +} + +.callout.info { + background: rgba(59, 130, 246, 0.1); + border-left-color: var(--info); +} + +.callout.info .callout-title { + color: var(--info); +} + +/* Scrollbar styling for dark theme */ +.docs-sidebar::-webkit-scrollbar, +.docs-toc::-webkit-scrollbar { + width: 8px; +} + +.docs-sidebar::-webkit-scrollbar-track, +.docs-toc::-webkit-scrollbar-track { + background: transparent; +} + +.docs-sidebar::-webkit-scrollbar-thumb, +.docs-toc::-webkit-scrollbar-thumb { + background: var(--border); + border-radius: 4px; +} + +.docs-sidebar::-webkit-scrollbar-thumb:hover, +.docs-toc::-webkit-scrollbar-thumb:hover { + background: var(--surface-hover); +} diff --git a/src/app/docs/layout.tsx b/src/app/docs/layout.tsx index 8d133ee..6b9c5e5 100644 --- a/src/app/docs/layout.tsx +++ b/src/app/docs/layout.tsx @@ -1,5 +1,6 @@ import { Header } from '@/components/Header'; import { SearchPalette } from '@/components/SearchPalette'; +import './docs.css'; export default function DocsLayout({ children @@ -9,7 +10,9 @@ export default function DocsLayout({ return ( <>
- {children} +
+ {children} +
); diff --git a/src/components/Breadcrumbs.tsx b/src/components/Breadcrumbs.tsx index 917fcc0..3a6eb01 100644 --- a/src/components/Breadcrumbs.tsx +++ b/src/components/Breadcrumbs.tsx @@ -9,16 +9,16 @@ export function Breadcrumbs({ items }: BreadcrumbsProps): JSX.Element | null { if (items.length === 0) return null; return ( -