Repository navigation
Serve the CSS as cached files, and load page CSS only where used - #93
Merged
Merged
Conversation
Every page inlined all 282 KB (54 KB gzipped) of the CSS, uncached, so all
531 pages carried it. The integration now lets Astro link the stylesheets
as hashed files ('auto'), which browsers cache across pages.
explorer.css (home) and episode.css (episode, About, Contact, For LLMs)
leave global.css and are imported by the pages that use them. Astro links
a page's own sheet ahead of the shared one on a full load, and after it
on a client-side navigation, so the rules in them that override a shared
class (.icon-button, .person-face, .PropFLIP, .button-secondary, the
stage's long-line size) now outrank it by specificity instead of by
position. The segmented control's thumb drops a glide transition its own
transition always overrode.
Fourteen single-class blocks of plain utility properties move to Tailwind
classes in the markup, keeping the class itself as the customCss hook.
Tailwind's own sr-only replaces the copy in tokens.css.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 9 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
The reference site's sponsor page uses .ep-reveal and .ep-grow but does not load episode.css, so splitting the page CSS left its cards and chart bars without their scroll-driven entrance. They are general-purpose reveal utilities, so they move to global.css with their keyframes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The goal is to merge
media-redesigninto main with confidence. The pre-merge review found that every page inlines all of the site's CSS: about 282 KB raw, 54 KB gzipped (main ships 18.5 KB gzipped).build.inlineStylesheets: 'always'put the whole sheet in a<style>on all 531 pages, so no visit could cache it.global.cssalso pulled the explorer and episode styles into every page, /about/ included.'always'came from "Always inline stylesheets" (da6b1ff, September 2025). The commit has no message body and was made when the CSS was a few KB. Nothing in the history ties it to view transitions or the persisted dock, and the client-side navigation check below shows the dock and page styles arriving correctly without it.What changed
inlineStylesheets: 'auto'. Astro links the stylesheets as hashed/_astro/*.cssfiles, which the browser caches across pages. Only the 2.1 KB of@font-facestays inline.explorer.cssis now imported by the home page only.episode.cssis imported by the episode, About, Contact and For LLMs pages. Both use@reference './tailwind.css'so--spacing()still compiles..icon-button.xp-top,.person-face.xp-pick-face,.PropFLIP.xp-text,.PropFLIP:is(.xp-facts, .xp-title),.PropFLIP.ep-person,.PropFLIP.ep-who-box,.button-secondary.ep-more, and.stageon the narrow-script line size. The segmented control's thumb dropsdata-⚓️-transition="glide", because its own transition always overrode it. A comment at the top of each page sheet explains the rule..xp-seg,.xp-chip,.person-chip,.person-fact,.person-speaking,.rail-label,.rail-fly-title,.platforms,.glyph,.empty,.island-more-pop,.xp-fading-text,.xp-fading-cardand.ep-split-gauge. Each element keeps its class name as thecustomCsshook.tokens.css's.sr-onlyis deleted in favour of Tailwind's own. A block was moved only if no unlayered rule that used to lose to it would beat the utilities. That ruled out.platform, because anchored-auto-layout's[data-⚓️-fill]sizes it, and.mini-button,.link-onand.stage-frame, whichinteractions.css,aand.PropFLIPwould override.Verification
All of these ran against
pnpm buildoutput from this branch and fromorigin/media-redesign.CSS per page, raw / gzip, measured from the built HTML and the files it links:
//about//contact//404Inline
<style>across all 531 pages went from 146.4 MB to 1.1 MB. After the first page, the shared 41.5 KB comes from cache, so the next page costs at most its own 5 to 9 KB sheet./, an episode,/about/and/contact/, at 1440 and 390px./, the episode and About: 0 pixels differ..sr-onlyborders are now width 0 instead of style none, and it clips withclip-pathinstead ofclip;rounded-fullcomputes to a different value than 999px;.person-chip's decoration thickness changed, but it has no underline./→ episode →/→/about/→ episode with the ClientRouter keeps the same document. Each step adds the right page sheet and drops the old one, and the explorer grid and the episode bar are styled after each step.pnpm lintpasses.pnpm test:unitpasses 273 of 273.pnpm buildpasses,astro checkincluded.shell.spec.ts,explorer.spec.tsandepisode.spec.tspass 83 of 83, against a dev server on its own port. The first attempt had a DNS failure fetching the RSS feed, which crashed the dev server. The rerun passed.One behavior to know
A site's
customCssstill loads afterglobal.css. Againstexplorer.cssandepisode.css, though, it now wins ties only on a full page load, because after a client-side navigation the page sheet lands after it. The documented use, setting theme variables on:root, is unaffected, because those variables live intokens.css. AcustomCssrule that restyles an explorer or episode selector needs higher specificity than the built-in one.🤖 Generated with Claude Code