From eaef3f8e84edcb543dbcc6fbade55199d27845f8 Mon Sep 17 00:00:00 2001 From: Ken Date: Wed, 27 May 2026 04:02:12 +0000 Subject: [PATCH] feat: implement three-width layout system (reading, wide, full-bleed) Replace the narrow 720px column layout with a three-width breakout system: - Reading width (--width-prose, 720px): prose paragraphs, lists, blockquotes - Wide width (--width-code, 840px): code blocks, inline SVGs, figures, .wide/.breakout - Full width (--width-container, 1100px): hero diagrams, .full elements The outer container is wide; individual content blocks self-constrain via max-width + margin: auto. This creates the narrow-wide-narrow rhythm. Changes: - prose.css: Add .prose > * breakout pattern for three widths, SVG styling - BaseLayout.astro: Remove max-width from main (children handle their own widths) - [...slug].astro: Remove --width-prose constraint from .prose-wrapper - prose.css: Remove old left:50%/translateX(-50%) code block hack --- src/layouts/BaseLayout.astro | 3 - src/pages/posts/[...slug].astro | 1 - src/styles/prose.css | 48 ++++++++++-- tests/final-verification.test.mjs | 11 ++- tests/post-page.test.mjs | 3 +- tests/three-width-layout.test.mjs | 119 ++++++++++++++++++++++++++++++ 6 files changed, 169 insertions(+), 16 deletions(-) create mode 100644 tests/three-width-layout.test.mjs diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index c6491f0..c7dfb00 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -87,9 +87,6 @@ const base = import.meta.env.BASE_URL; } main { - max-width: var(--width-container); - margin-left: auto; - margin-right: auto; padding-left: var(--gutter); padding-right: var(--gutter); } diff --git a/src/pages/posts/[...slug].astro b/src/pages/posts/[...slug].astro index 3ff1d24..22e2232 100644 --- a/src/pages/posts/[...slug].astro +++ b/src/pages/posts/[...slug].astro @@ -41,7 +41,6 @@ const readingTime = post.body ? getReadingTime(post.body) : undefined;