Repository navigation
Redesign: remove the unused legacy stylesheet - #42
Conversation
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
|
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. |
|
Independent review checkpoint: head Setup: Node 24.22.1, Bun 1.4.4. Content at 1. Rendered output
2. Scope: 3 files: 3. Build and tests: 4. Secrets and personal data: none. The diff only removes CSS and changes one documentation line. Generated by Claude Code |
Follows #29 (PR #36) and #33 (part of #35). PR #36 kept the old content styles in
src/styles/legacy.cssuntil 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
src/styles/legacy.cssand its import insrc/layouts/Layout.astro. Its 36 rules were scoped to.legacy/:where(.legacy), apart from a globalhtml { font-size: 18px }.AGENTS.md: thesrc/styles/line no longer mentionslegacy.css. No other file mentions the file or the class. ("Existing legacy links" indocs/document-sharing.mdis about old portfolio links and is unrelated.)Why the rendered site stays the same
legacyclass. It appears nowhere insrc/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.rem, and onlylegacy.cssusedrem. In the base build's CSS, everyremis one of that file's 29remdeclarations, all under.legacy. In this build, no CSS, HTML or JS file indist/has arem. The only one left is inllms-full.txt, which holds the articles' Markdown as text.<body>setsfont: 13px/1.6and 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.thoughts-on-human-ai-collaboration) hasmargin: 1.5rem 0inline on its YouTube wrappers.rehype-article.mjsreplaces those wrappers with its own figure, so thatremnever 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.csswas never in a separate.cssfile: it sat in the inline CSS of the 60 pages built withLayout. The two.cssfiles indist/_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.cssOrderinastro/dist/core/build/runtime.js), then by depth. Removing Layout's second import has two effects:legacy.cssalso holds ClientRouter's.astro-route-announcerrule. It used to takelegacy.css's early position, right afterglobal.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.data-astro-cid-*attribute, and no element in the 62 pages has two of them. The unscoped rules that moved areh1[…] 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.@mediaconditions 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..astro-route-announcer, a class that only Astro's router gives, to the div it adds.Validation
Head commit
61b24fda1d0c810c45094cdfa126f5512796861f, on base118b7812934293d56aa0d2e644ee91e74bf8df34(origin/redesign). Node 24.22.1, Bun 1.4.4. Content submodule atbf783ba(git submodule update --init --remote; the pointer is unchanged).bun install, thenbun run buildwithdist/andnode_modules/.astrocleared: passes, 62 pages, for base and head alike.bun run test:documents: 10 tests, 10 passed.llms*.txttimestamps.dist/, base against head (same content). 157 files on each side._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.txtandllms-full.txtdiffer only in their build timestamp./404.htmland/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./documents/. Each page was taken at 1440px and 375px, full page.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.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_somethingandthoughts-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.<html>,<body>and every element in it, plus::before/::afterwith content and the::markerof 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>'sfont-size, 18px → 16px, on the 60Layoutpages.autoside 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).<html>'s font size.remand the root size: I searched the built CSS forrem. In the base build, every hit was in the deleted file's rules under.legacy; in this build there are none.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:
Self-review of the diff and of every remaining mention of
legacy,remand the root size. Nothing to fix.Independent review (code review at medium). It found two things, both about the 18px root:
margin: 1.5rem 0written in one article's Markdown;I checked both and neither changes the page.
rehype-article.mjsreplaces those wrappers, so the built site has norem, and the page is pixel-identical. The 24px and 12px font size runs above are pixel-identical too. Nothing to fix.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
automargins. Each one also happens within the base build alone, or goes away when the moving part is hidden. Nothing to fix.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