Skip to content

Redesign: remove the unused legacy stylesheet - #42

Merged
meaningfool merged 1 commit into
redesignfrom
redesign-33-remove-legacy
Nov 3, 2026
Merged

meaningfool merged 1 commit into
redesignfrom
redesign-33-remove-legacy

Conversation

@meaningfool

@meaningfool meaningfool commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Follows #29 (PR #36) and #33 (part of #35). PR #36 kept the old content styles in src/styles/legacy.css until each page was rebuilt, and planned that "the last one deletes this file". Now that the home (#31, PR #40), the article page (#32, PR #39) and About (#33, PR #41) are merged, this PR deletes it.

What changes

  • Deleted src/styles/legacy.css and its import in src/layouts/Layout.astro. Its 36 rules were scoped to .legacy / :where(.legacy), apart from a global html { font-size: 18px }.
  • AGENTS.md: the src/styles/ line no longer mentions legacy.css. No other file mentions the file or the class. ("Existing legacy links" in docs/document-sharing.md is about old portfolio links and is unrelated.)
  • Nothing else changes.

Why the rendered site stays the same

  • No page uses the legacy class. It appears nowhere in src/ outside the deleted file, and in the base build none of the 62 HTML pages has an element with that class. So none of the scoped rules applied to anything.
  • The 18px root size was only used by rem, and only legacy.css used rem. In the base build's CSS, every rem is one of that file's 29 rem declarations, all under .legacy. In this build, no CSS, HTML or JS file in dist/ has a rem. The only one left is in llms-full.txt, which holds the articles' Markdown as text. <body> sets font: 13px/1.6 and every other size is in px, so nothing inherits the root size either. <html> now computes to the browser default (16px) instead of 18px. Nothing visible depends on that value.
  • One article's Markdown (thoughts-on-human-ai-collaboration) has margin: 1.5rem 0 inline on its YouTube wrappers. rehype-article.mjs replaces those wrappers with its own figure, so that rem never reaches the page.

One difference in the HTML: the CSS order

Astro inlines small CSS chunks (under 4 KB) in <style>, merging neighbouring ones. legacy.css was never in a separate .css file: it sat in the inline CSS of the 60 pages built with Layout. The two .css files in dist/_astro/ keep their names and bytes. In those 60 pages, the <style> content changes: the legacy rules are gone, and the remaining rules, the same set, come in a different order.

  • Cause: Astro orders a page's CSS chunks by the sum of import positions along the path from the page (cssOrder in astro/dist/core/build/runtime.js), then by depth. Removing Layout's second import has two effects:
    • The chunk that held legacy.css also holds ClientRouter's .astro-route-announcer rule. It used to take legacy.css's early position, right after global.css. Now its position comes from the longer path Layout → IntroRouter → ClientRouter, so it comes last. On articles that is after _slug_.css, so it gets its own small <style> after that link.
    • Background and Frame (which brings Header, Footer and Wordmark) each move up one import in Layout. On Home and About their chunk now comes before TopicMap/Intro (and About's own styles) instead of after them.
  • Why it can't matter: every component rule carries that component's data-astro-cid-* attribute, and no element in the 62 pages has two of them. The unscoped rules that moved are h1[…] span (Intro), :root:has(.about .parts) (About, only without reduced motion) and .astro-route-announcer, and none of them can meet a rule of another moved group.
    • I checked this mechanically. For each of the 6,974 rule pairs whose order changed, I widened both selectors: pseudo-classes, pseudo-elements, attribute selectors other than the scope attribute and @media conditions dropped. I then queried them on the page, with the router's announcer element added. No pair selects a common element while setting a common property.
    • Even with class selectors dropped as well, the only pairs left involve .astro-route-announcer, a class that only Astro's router gives, to the div it adds.
  • Keeping the old order would take an import with no other purpose than to hold Astro's numbering in place, so I left it.

Validation

Head commit 61b24fda1d0c810c45094cdfa126f5512796861f, on base 118b7812934293d56aa0d2e644ee91e74bf8df34 (origin/redesign). Node 24.22.1, Bun 1.4.4. Content submodule at bf783ba (git submodule update --init --remote; the pointer is unchanged).

  • Build and tests:
    • bun install, then bun run build with dist/ and node_modules/.astro cleared: passes, 62 pages, for base and head alike.
    • bun run test:documents: 10 tests, 10 passed.
    • A fresh build of the head commit is byte-identical to the build tested below, apart from the llms*.txt timestamps.
  • dist/, base against head (same content). 157 files on each side.
    • Byte-identical: both _astro/*.css (same names), all JS, rss.xml, sitemap-index.xml, sitemap-0.xml, _headers, _redirects, robots.txt, and the 59 images, videos, fonts and icons. llms.txt and llms-full.txt differ only in their build timestamp.
    • HTML: /404.html and /documents/ are byte-identical. The other 60 pages are identical once the <style> and stylesheet links are set aside. In each of them, the CSS rules, in cascade order, are the base's minus the legacy rules, reordered as explained above.
  • Screenshots (headless Chromium, Playwright): every built page, 62 in all. That covers the home, About, all 58 articles and activity logs (tables, code, YouTube embeds, videos, an animated image), the 404 page (an unknown URL) and /documents/. Each page was taken at 1440px and 375px, full page.
    • Method: the window was made as tall as the page, so the fixed pattern covers it. Each page was compared twice: once with the background hidden (page-background { visibility: hidden }), and once with it shown. With the background shown, the screenshot waited until every canvas (paper, corner pattern, map) had its box's size and nothing had changed for four polls 150ms apart. Requests to other hosts were blocked on both sides, so the YouTube frames are empty in both.
    • Results: I ran the whole set twice: 248 pairs per run (62 pages × 2 widths × background hidden and shown). Each run gave 245 identical pairs and 3 that differed. Every pair that differed in one run was identical in the other or in a rerun. In each case the difference is a moving part caught at another moment, not a style:
      • we-cant-stop-planning, 1440px: rows 1557–2194, which is the animated WebP caught on another frame. The base build differs from itself in exactly those rows when taken 300ms and 1300ms after load. With that image hidden, 6 of 6 matched.
      • antigravity_is_onto_something and thoughts-on-human-ai-collaboration, 1440px: about 500 pixels in 4 rows, which is the video's buffered-range bar (how much of the mp4 had loaded). With the videos hidden, 8 of 8 matched.
      • agent-frameworks-for-the-rest-of-us, 1440px, background shown: at 36,855px it is taller than the 30,000px window, so it goes through Playwright's full-page capture, which sometimes leaves part of it unpainted. The base build differs from itself in 2 of 3 runs. With the background hidden, it matched every time.
    • Home ↔ About through the client router, at both widths: no full load, and the screenshots after the swap are identical.
  • Computed styles: for <html>, <body> and every element in it, plus ::before/::after with content and the ::marker of list items, I compared every property on every page at both widths, and in the second run each box's position and size too. That is 19,182 boxes per build in each run. The only difference is <html>'s font-size, 18px → 16px, on the 60 Layout pages.
    • In 4 of the 248 readings, an auto side margin read as 0px on one side and as its used value on the other: the 1240px frame at 1440px (Home, About twice, antigravity_is_onto_something), and on that article its <main> too. Chromium reports either value from one load to the next, the base build alone included (0px, 0px, 100px over three loads of Home). The boxes were the same every time (the frame at x 100, width 1240).
    • After a router swap, the only difference is still <html>'s font size.
  • rem and the root size: I searched the built CSS for rem. In the base build, every hit was in the deleted file's rules under .legacy; in this build there are none.
    • The root's size now follows the reader's default font size setting, where it used to be fixed at 18px. To check that this changes nothing, I compared base and head with the default font size set to 24px and to 12px (Page.setFontSizes). I used 9 pages: Home, About, three articles, two logs, the 404 and /documents/.
    • <html> becomes 24px or 12px and <body> stays 13px. 35 of 36 screenshots were identical. The one exception, the embed article at 375px and 24px, matched in the 8 loads that followed (4 per build).

Review gate

4 passes over the whole change:

  1. Self-review of the diff and of every remaining mention of legacy, rem and the root size. Nothing to fix.

  2. Independent review (code review at medium). It found two things, both about the 18px root:

    • the margin: 1.5rem 0 written in one article's Markdown;
    • the root now following the reader's default font size.

    I checked both and neither changes the page. rehype-article.mjs replaces those wrappers, so the built site has no rem, and the page is pixel-identical. The 24px and 12px font size runs above are pixel-identical too. Nothing to fix.

  3. Every screenshot and computed-style difference traced to its cause: the animated image, the video's buffer bar, the full-page capture of the 36,855px page, and Chromium's reading of auto margins. Each one also happens within the base build alone, or goes away when the moving part is hidden. Nothing to fix.

  4. Rerun on the head commit: a fresh build equal to the tested one, a second full screenshot and computed-style run (with box geometry), the client-router check and the tests. Same results. Nothing to fix.

🤖 Generated with Claude Code

https://claude.ai/code/session_013MdjUerTCBDeF5DG9puDd2

The home (#31), the article page (#32) and About (#33) have been rebuilt,
so no page carries the legacy class any more. src/styles/legacy.css, kept
for them since #29, only still set the root font size to 18px, which
nothing uses: no other rule is in rem, and body sets its own 13px, so no
text inherits it. Remove the file, its import in Layout and its mention in
AGENTS.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013MdjUerTCBDeF5DG9puDd2
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Preview: https://pr-42-meaningfool.josselin-perrus.workers.dev

Built from 61b24fd with the latest content. The link stays the same and shows the latest push. Search engines are asked not to index it.

Copy link
Copy Markdown
Owner Author

Independent review checkpoint: head 61b24fda1d0c810c45094cdfa126f5512796861f, base 118b7812934293d56aa0d2e644ee91e74bf8df34 (redesign). No P1 or P2 findings, so nothing was pushed.

Setup: Node 24.22.1, Bun 1.4.4. Content at bf783ba (git submodule update --init --remote), the same for both builds. I ran bun install, then built base and head with dist/ and node_modules/.astro cleared first.

1. Rendered output

  • dist/: 157 files on each side, same names. Everything is byte-identical except 60 HTML pages and the two llms*.txt, which differ only in their Generated: timestamp. Both _astro/*.css files keep the same names and bytes. /404.html and /documents/ are byte-identical.

  • HTML outside the CSS: with <style> and stylesheet <link> elements set aside, the 60 pages are byte-identical. The articles' new 166-byte <style>, which holds .astro-route-announcer, sits in <head> after the _slug_ link.

  • CSS: on each of the 60 pages, the head's rules are the base's minus exactly the 36 legacy.css rules, as a multiset, with nothing added. The other rules are reordered: 6,974 rule pairs swap order. I checked which swapped pairs could meet on an element. For a pair to meet, the element would need both rules' data-astro-cid-* in its subject. Only 173 swapped pairs lack scope attributes in both subjects, and every one of them involves one of three rules:

    • .astro-route-announcer: the router creates its div as a direct child of body, with no scope attribute. On articles there is no router at all.
    • h1[data-astro-cid-fmp4ekgg] span: in the DOM, those spans carry only the page's own scope (lcdefpme / ta2fbyqs), and that page group did not move relative to Intro.
    • :root:has(.about .parts) { scroll-behavior }: <html> has no scope attribute, and no rule that moved past it selects the root.

    No script adds scope attributes, and no element on any page, base or head, has two of them, including after router swaps. So the reordering cannot change the cascade.

  • Root font size: with the file gone, no rem/rlh/rex/rch/rcap/ric unit is left in any built CSS, HTML, JS or SVG. The only rem left is the article Markdown in llms-full.txt. body sets 13px, and <html> sets only background and colour.

  • Screenshots (Playwright Chromium, external hosts blocked): all 62 pages at 1440 and 375, full page, window as tall as the page (capped at 30,000px), after canvases settled. That is 124 base/head pairs; 120 were pixel-identical. The 4 that differed were all moving parts:

    • we-cant-stop-planning, both widths: the animated WebP. Base against base differs in the same rows.
    • antigravity_is_onto_something, 375: 14 px of the video's buffer bar.
    • agent-frameworks-for-the-rest-of-us, 1440: 36,805px tall, past the capture cap. Base against base differs too.

    On rerun, all 4 were identical with the video and the animated image hidden, and the tall page with the background both shown and hidden.

  • Computed styles: every property of <html>, <body> and every element, plus ::before/::after with content and list ::marker, along with each box's position and size. I compared at the normal window height and at full height: 19,182 boxes per build. The only difference is <html> font-size 18px → 16px on the 60 Layout pages. One exception: on About at 1440, Chromium reported .frame's auto margins as 0px on one side and 100px on the other, with the same box. Home base against base reproduces it, so it is reader noise.

  • Other settings:

    • Default font size 24px and 12px (Page.setFontSizes), on Home, About, an article, a log, the 404 and /documents/: pixel-identical, and only <html> font-size differs.
    • Reduced motion, on Home, About and an article: identical.
  • Client router, Home ↔ About (both starting pages, there and back, at both widths): no full load, the router's announcer is present, the screenshots are identical, and computed styles and boxes are identical apart from <html> font-size.

2. Scope: 3 files: legacy.css deleted, its import in Layout.astro removed, and the src/styles/ line in AGENTS.md. Nothing else in the repository mentions legacy.css, the .legacy class or the 18px root, including docs/redesign/ and README. The only legacy hit is the unrelated "Existing legacy links" in docs/document-sharing.md.

3. Build and tests: bun run build passes for base and head, with 62 pages each. bun run test:documents passes, 10 of 10. The PR's build check is green.

4. Secrets and personal data: none. The diff only removes CSS and changes one documentation line.


Generated by Claude Code

@meaningfool
meaningfool marked this pull request as ready for review November 3, 2026 22:56
@meaningfool
meaningfool merged commit b5c7f46 into redesign Nov 3, 2026
1 check passed
@meaningfool
meaningfool deleted the redesign-33-remove-legacy branch November 5, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants