Repository navigation
refactor(website): unify Astro/Starlight theme and streamline site CSS & components - #440
Merged
Merged
Conversation
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.
Summary
Unifies theme state, monochrome design tokens, and layout alignment across the Astro site pages (landing, blog, 404) and Starlight docs, then cleans up redundant CSS and duplicated head/animation boilerplate.
1. Theme, Color Tokens & Layout Alignment (
d600264).darkclass; both Astro site pages and Starlight docs now rely exclusively onhtml[data-theme](withhtml[data-theme-pref]for zero-FOUC 3-state icon rendering).ThemeToggle.astrointo a single-button 3-state cycle (auto → light → dark, respectingprefers-color-schemechanges and syncing multiple toggle instances) and wired it into Starlight viacomponents.ThemeSelectso docs and site pages share one toggle and View Transition reveal.--sl-color-*(including dark/light::backdrop) directly onto the site's OKLCH semantic tokens, moved--sl-content-width: 52remonto:rootso Starlight's header search bar and two-column grid stay aligned, and added@layer basefallbacks for Expressive Code /<Tabs>variables on non-Starlight pages.PostLayout.astro's broken'JetBrains Mono Variable'font reference tovar(--font-mono), aligned blog prose contrast with--sl-color-text, avoidedsystem-uifallback for Outfit on Windows CJK, addedcolor-scheme+ CJKtext-autospacein@layer base, and synced<meta name="theme-color">dynamically infavicon-theme.js.2. CSS Inlining &
site.cssBoundary Split (c009ab3)<style>rules into Tailwind utilities acrossFeatureCard.astro,Hero.astro,TapeModel.astro,HookIntro.astro, andTestimonials.astro(removing<style>blocks completely fromFeatureCardandHero).--site-*variables (dropping 6 unused ones),.site-code-block, and.install-tabsfromglobal.cssintosite.cssso Starlight docs pages no longer bundle unused landing styles, while keeping shadcn tokens,.sl-markdown-content, and.pele-diagraminglobal.css.3. Shared Head Assets & Viewport Loop Helper (
fbd7ac9)SiteHeadAssets.astro(fonts,theme-color, adaptive favicons, inline theme init,favicon-theme.js) and reused it in bothBaseLayout.astroandStarlightHead.astro, removing the duplicatedheadarray inastro.config.mjs.src/lib/viewport-loop.ts(mountViewportLoop) to deduplicateinView+prefers-reduced-motion+visibilitychange+astro:page-loadlifecycle boilerplate acrossTestimonials.astro,HookIntro.astro, andTapeModel.astro, and added a static fallback state forTapeModel.astrounder reduced motion.TapeModel.astro.Impacted Modules
website/only (Astro config, layouts, landing/UI components,src/styles/,src/lib/viewport-loop.ts,public/favicon-theme.js,website/AGENTS.md)Verification
pnpm fmt:check(oxfmt --check): 49 files passedpnpm check(astro check): 0 errors, 0 warnings across 45 filesnode --test website/scripts/pele.test.mjs: 3/3 passedpnpm build(astro build): 83 static pages + Pagefind index built cleanly; verified built HTML/CSS bundles for landing, blog, EN docs, and ZH-CN docs