Fix ultrawide layout: Tailwind was not generating max-width classes.

Move width utilities into scanned components as literal class names, add lib to Tailwind content and safelist. Verified max-w-4xl in build CSS and /learn HTML.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-11 00:38:00 +08:00
parent 9fc7336095
commit 26ccecb361
5 changed files with 29 additions and 37 deletions
+10 -5
View File
@@ -1,12 +1,17 @@
import Header from "@/components/header";
import Footer from "@/components/footer";
import TaijiBackdrop from "@/components/layout/taiji-backdrop";
import {
CONTENT_SHELL,
type ContentShellWidth,
} from "@/lib/layout";
import { cn } from "@/lib/utils";
/** 必须在组件内写完整类名,Tailwind 才能生成对应 CSS */
const SHELL_WIDTH = {
default: "w-full max-w-4xl px-4 sm:px-6 lg:px-8",
narrow: "w-full max-w-3xl px-4 sm:px-6 lg:px-8",
wide: "w-full max-w-4xl px-4 sm:px-6 lg:px-8",
} as const;
export type ContentShellWidth = keyof typeof SHELL_WIDTH;
export default function PageShell({
children,
className = "",
@@ -23,7 +28,7 @@ export default function PageShell({
<main
className={cn(
"mx-auto flex w-full flex-1 flex-col border-border/40 bg-background sm:border-x",
CONTENT_SHELL[width],
SHELL_WIDTH[width],
className,
)}
>