This commit is contained in:
2026-02-28 23:35:34 +08:00
parent 3956ee4806
commit 562c316c54
5 changed files with 129 additions and 16 deletions

View File

@@ -38,11 +38,11 @@ export default async function DocPage({ params }: { params: Promise<{ slug: stri
return (
<article className="doc-page-container">
<h1 className="text-4xl font-bold mb-4">{doc.meta.title}</h1>
{doc.meta.description && (
<p className="text-xl text-gray-500 dark:text-gray-400 mb-8">{doc.meta.description}</p>
<h1 className="doc-page-title">{doc!.meta.title}</h1>
{doc!.meta.description && (
<p className="doc-page-description">{doc!.meta.description}</p>
)}
<DocContent contentHtml={doc.contentHtml} />
<DocContent contentHtml={doc!.contentHtml} />
</article>
);
}

View File

@@ -114,6 +114,68 @@ body {
letter-spacing: 0.05em;
}
/* Theme Toggle Button */
.theme-toggle {
background: transparent;
border: 1px solid var(--border-color);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
border-radius: 9999px;
width: 38px;
height: 38px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: var(--text-secondary);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
overflow: hidden;
position: relative;
}
.theme-toggle:hover {
background: var(--bg-secondary);
color: var(--text-primary);
border-color: var(--text-muted);
box-shadow: 0 0 10px var(--accent-glow);
}
.theme-toggle-icon-wrapper {
position: relative;
width: 20px;
height: 20px;
}
.theme-toggle-sun,
.theme-toggle-moon {
position: absolute;
top: 0;
left: 0;
transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Light Mode State */
.theme-toggle.is-light .theme-toggle-sun {
opacity: 1;
transform: rotate(0deg) scale(1);
}
.theme-toggle.is-light .theme-toggle-moon {
opacity: 0;
transform: rotate(90deg) scale(0);
}
/* Dark Mode State */
.theme-toggle.is-dark .theme-toggle-sun {
opacity: 0;
transform: rotate(-90deg) scale(0);
}
.theme-toggle.is-dark .theme-toggle-moon {
opacity: 1;
transform: rotate(0deg) scale(1);
}
.sidebar-nav {
flex: 1;
overflow-y: auto;
@@ -166,9 +228,16 @@ body {
}
.sidebar-section-arrow {
font-size: 0.6rem;
display: flex;
align-items: center;
justify-content: center;
color: var(--text-muted);
transition: transform 0.2s ease;
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-section-arrow svg {
width: 1rem;
height: 1rem;
}
.sidebar-section-arrow.open {
@@ -210,6 +279,30 @@ body {
font-weight: 500;
}
/* --- DocPage container and hero --- */
.doc-page-container {
max-width: 800px;
margin: 0 auto;
}
.doc-page-title {
font-size: 2.5rem;
font-weight: 800;
color: var(--text-primary);
letter-spacing: -0.03em;
line-height: 1.2;
margin: 0 0 1rem 0;
}
.doc-page-description {
font-size: 1.125rem;
color: var(--text-muted);
margin: 0 0 2.5rem 0;
line-height: 1.6;
border-bottom: 1px solid var(--border-color);
padding-bottom: 2rem;
}
/* --- DocContent (Markdown) Styles --- */
.doc-article {
color: var(--text-primary);
@@ -365,10 +458,4 @@ body {
border: 0;
border-top: 1px solid var(--border-color);
margin: 3rem 0;
}
/* Title container wrapper inside article to strip Tailwind prose max-width constraint */
article {
max-width: 800px;
margin: 0 auto;
}