Skip to content

refactor(website): substrate migration batch 2 — shared chrome off inline styles - #849

Merged
blove merged 4 commits into
mainfrom
blove/style-substrate-batch-2
Aug 29, 2026
Merged

refactor(website): substrate migration batch 2 — shared chrome off inline styles#849
blove merged 4 commits into
mainfrom
blove/style-substrate-batch-2

Conversation

@blove

@blove blove commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

What

Batch 2 of the substrate migration (plan, Task 2): Nav, Footer, and AnnouncementToast move to src/styles/chrome.css. 33 presentation-only mouse-handler pairs are deleted (23 in Footer, 5 in Nav, plus the Toast input's focus/blur pair) and replaced by :hover/:focus rules — 66+ handler props gone from the chrome.

Also carries a critical infrastructure fix, below.

The infrastructure fix: late @import is silently dropped in dev

Batch 1 placed the six scope-file @imports after global.css's :root block. Late @import is invalid CSS — the production pipeline (Lightning CSS) forgives it by hoisting, but turbopack dev silently drops the imported files, intermittently across recompiles: no error, the rules just never load. It surfaced when a verification baseline captured the nav logo as Inter 400 where ui.css says Garamond 700.

Production was never affected — verified the deployed CSS contains every batch-1 rule ([data-ui=button] ×6, [data-ui=card] ×10, …). The imports now sit at the top where they're spec-valid everywhere, and the plan's Task 0 caution (which wrongly assumed the failure would be a build error) is corrected.

Verification — measured against production

Since main == production == the pre-batch-2 truth, the baseline for this batch is the live site, hashed per element at pinned viewports:

surface viewport result
nav + footer, all 77 elements × 24 computed properties 1280×900 77/77 hash-identical to prod
mobile overlay (open), 13 elements × 20 properties 375×812 13/13 hash-identical to prod
.footer-link:hover / .nav-link:hover rules present, target --color-accent — exactly what the deleted handlers wrote

Plus: vitest at the pre-existing baseline (5 failed | 341 passed), 0 lint errors, prod build green with nav-bar confirmed in the emitted bundle.

Notes for review

  • Nav's mobile-overlay top: 57 migrated verbatim as top: 57px — the polish arc owns changing it.
  • The Toast onFocus/onBlur border toggle → .toast-input:focus was a judgment call (same presentation-only pattern as hover); flagged by the implementer, accepted.
  • Footer keeps 'use client' — its NewsletterForm has real submit state.
  • Hardcoded #1a7a40 success greens kept as literals (match no token) — restyling is out of scope.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
threadplane Ready Ready Preview Aug 29, 2026 8:47pm

Request Review

@blove
blove enabled auto-merge (squash) August 29, 2026 20:13

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated approval: this PR received an intelligent (AI) code review. See the review comments on this PR.

@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

blove and others added 4 commits August 29, 2026 13:44
…ecome :hover

Move Footer.tsx's static presentation (root background/border, tagline,
newsletter success/input, column eyebrows, social icons, link colors,
bottom bar) into chrome.css as .footer-* classes. Replace all 23
onMouseEnter/onMouseLeave color-toggle pairs with :hover rules; one
.footer-link class covers the 19 identical column-link styles and one
.footer-social-link covers the two icon links. Footer keeps 'use client'
(NewsletterForm has real submit state).
Move Nav.tsx's static presentation into chrome.css as .nav-* classes:
desktop links/GitHub icon (.nav-link), the demo dropdown
(.nav-demo-dropdown/-trigger/-caret/-menu/-item), the nav bar and
hamburger hit-area (comment preserved), the mobile overlay and its tab
bars (tabStyle/subTabStyle become .nav-mtab/.nav-msubtab with
[data-active]), and the mobile link lists (.nav-mobile-item/-site-link/
-github-link/-demo-link/-section-toggle/-chevron). Replace the 5
onMouseEnter/onMouseLeave color-toggle pairs with :hover rules; bounded
active-state ternaries become data-active/data-open attributes. The
mobile overlay's `top: 57` offset and the hamburger's negative-margin
hit-area trick move verbatim. Nav keeps 'use client' (menu/dropdown
state).
Move AnnouncementToast.tsx's static box/text presentation into
chrome.css as .toast-* classes. Root keeps only opacity/transform
inline (interpolated from the entrance-animation `mounted` state); all
other root styling (position, sizing, background/border/shadow,
padding, transition) moves. The one hardcoded hex success color
(#1a7a40) moves verbatim, unmapped to a token as in the source.

Also converts the email input's onFocus/onBlur border-color toggle
(the same presentation-only DOM-mutation pattern as the batch's hover
handlers, just focus-triggered) into a :focus rule — :focus rather
than :focus-visible so any focus method reproduces the original
behavior exactly.
Late @import is invalid CSS. The production pipeline forgives it by hoisting,
but turbopack dev silently DROPS the imported files - no error, the rules never
load, intermittently across recompiles. Found when the batch-2 verification
baseline captured the nav with ui.css dropped (the logo measured Inter 400
where ui.css says Garamond 700). Production was never affected - verified the
deployed CSS contains every batch-1 rule.

Also updates the plan's Task 0 caution, which wrongly assumed the failure mode
would be a build error.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@blove
blove force-pushed the blove/style-substrate-batch-2 branch from 93b7db1 to de15bc1 Compare August 29, 2026 20:44
@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

@blove
blove merged commit 34c341a into main Aug 29, 2026
23 checks passed
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.

1 participant