Skip to content

Commit a62334d

Browse files
feat: Public Sans font + homepage hero redesign (#137)
Font stack: - Add self-hosted Public Sans via Fontsource (400, 500, 600 weights) - ~35KB total WOFF2, no third-party requests, GDPR-safe - font-display: swap by default (no layout shift) Homepage hero redesign: - Eyebrow: "Independent civic tech project" in small caps - Title: 48px/60px, -0.03em tracking, navy/amber - Subtitle: "Every change to federal law, tracked through Git." - Two CTAs: "Browse all titles" (filled) + "How it works" (outlined) - Stats: larger (3xl), tabular-nums, cleaner layout without borders - Explanation paragraph moved below stats for natural reading flow Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4f6a0d2 commit a62334d

5 files changed

Lines changed: 49 additions & 23 deletions

File tree

apps/web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"@astrojs/rss": "^4.0.18",
1616
"@astrojs/svelte": "^8.0.4",
1717
"@civic-source/types": "workspace:*",
18+
"@fontsource/public-sans": "^5.2.7",
1819
"@octokit/rest": "^22.0.1",
1920
"@tailwindcss/typography": "^0.5.19",
2021
"@tailwindcss/vite": "^4.2.2",

apps/web/src/layouts/BaseLayout.astro

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
import '../styles/global.css';
3+
import '@fontsource/public-sans/400.css';
4+
import '@fontsource/public-sans/500.css';
5+
import '@fontsource/public-sans/600.css';
36
import ThemeToggle from '../components/ThemeToggle.svelte';
47
import SearchBar from '../components/SearchBar.svelte';
58
import BackToTop from '../components/BackToTop.svelte';

apps/web/src/pages/index.astro

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -79,40 +79,54 @@ const base = import.meta.env.BASE_URL;
7979
title="Home"
8080
description="Track changes to the United States Code with Git-based version control and diff history."
8181
>
82-
<h1 class="text-navy dark:text-amber">US Code Tracker</h1>
83-
84-
<p>
85-
US Code Tracker converts each release of the United States Code into a Git
86-
repository, making it possible to view the precise text that changed between
87-
any two releases of federal law.
88-
</p>
82+
<!-- Hero -->
83+
<section class="not-prose py-10 text-center">
84+
<p class="mb-3 text-xs font-medium uppercase tracking-widest text-slate dark:text-gray-500">Independent civic tech project</p>
85+
<h1 class="mb-4 text-5xl font-semibold tracking-tight text-navy dark:text-amber md:text-6xl" style="letter-spacing: -0.03em; line-height: 1.1">US Code Tracker</h1>
86+
<p class="mx-auto mb-8 max-w-md text-lg text-slate dark:text-gray-300">
87+
Every change to federal law, tracked through Git.
88+
</p>
89+
<div class="flex flex-wrap justify-center gap-3">
90+
<a href={`${base}browse/`} class="rounded-lg bg-navy px-6 py-2.5 text-sm font-medium text-white transition-colors hover:bg-navy-dark dark:bg-teal dark:hover:bg-teal/80">
91+
Browse all titles
92+
</a>
93+
<a href="#how-it-works" class="rounded-lg border border-gray-300 px-6 py-2.5 text-sm font-medium text-slate transition-colors hover:border-navy hover:text-navy dark:border-gray-700 dark:text-gray-300 dark:hover:border-teal dark:hover:text-teal">
94+
How it works
95+
</a>
96+
</div>
97+
</section>
8998

90-
<!-- Quick stats -->
91-
<div class="not-prose my-6 flex flex-wrap gap-4">
92-
<div class="rounded-lg border border-teal/30 bg-teal/5 px-5 py-3 text-center font-sans">
93-
<p class="text-2xl font-bold text-teal">{titleCount}</p>
94-
<p class="mt-0.5 text-xs text-slate dark:text-gray-400">Titles</p>
99+
<!-- Stats -->
100+
<div class="not-prose flex flex-wrap justify-center gap-8 font-sans">
101+
<div class="text-center">
102+
<p class="text-3xl font-semibold text-navy dark:text-teal" style="font-variant-numeric: tabular-nums">{titleCount}</p>
103+
<p class="mt-1 text-sm text-slate dark:text-gray-400">Titles</p>
95104
</div>
96-
<div class="rounded-lg border border-teal/30 bg-teal/5 px-5 py-3 text-center font-sans">
97-
<p class="text-2xl font-bold text-teal">{sectionCount.toLocaleString()}</p>
98-
<p class="mt-0.5 text-xs text-slate dark:text-gray-400">Sections</p>
105+
<div class="text-center">
106+
<p class="text-3xl font-semibold text-navy dark:text-teal" style="font-variant-numeric: tabular-nums">{sectionCount.toLocaleString()}</p>
107+
<p class="mt-1 text-sm text-slate dark:text-gray-400">Sections</p>
99108
</div>
100-
<div class="rounded-lg border border-teal/30 bg-teal/5 px-5 py-3 text-center font-sans">
101-
<p class="text-2xl font-bold text-teal">PL 119-73</p>
102-
<p class="mt-0.5 text-xs text-slate dark:text-gray-400">Current through</p>
109+
<div class="text-center">
110+
<p class="text-3xl font-semibold text-navy dark:text-teal">PL 119-73</p>
111+
<p class="mt-1 text-sm text-slate dark:text-gray-400">Current through</p>
103112
</div>
104113
{releasePointCount > 0 && (
105-
<div class="rounded-lg border border-amber/30 bg-amber/5 px-5 py-3 text-center font-sans">
106-
<p class="text-2xl font-bold text-amber">{releasePointCount}</p>
107-
<p class="mt-0.5 text-xs text-slate dark:text-gray-400">Historical versions</p>
114+
<div class="text-center">
115+
<p class="text-3xl font-semibold text-amber" style="font-variant-numeric: tabular-nums">{releasePointCount}</p>
116+
<p class="mt-1 text-sm text-slate dark:text-gray-400">Historical versions</p>
108117
</div>
109118
)}
110119
</div>
111120
<p class="not-prose mt-2 text-xs text-gray-500 dark:text-gray-400 font-sans">
112121
Data syncs weekly from the Office of the Law Revision Counsel.
113122
</p>
114123

115-
<h2>What this project does</h2>
124+
<p class="not-prose mb-4 text-sm leading-relaxed text-slate dark:text-gray-400 font-sans">
125+
US Code Tracker converts each release of the United States Code into a Git
126+
repository, making it possible to view the precise text that changed between
127+
any two releases of federal law.
128+
</p>
129+
<h2 id="how-it-works">What this project does</h2>
116130
<ul class="not-prose my-4 space-y-2 font-sans text-sm text-gray-700 dark:text-gray-300">
117131
<li class="flex items-start gap-2">
118132
<span class="mt-0.5 text-teal" aria-hidden="true">&#x2193;</span>

apps/web/src/styles/global.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
@theme {
77
--font-serif: "Georgia", "Times New Roman", serif;
8-
--font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
8+
--font-sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
99
/* USWDS-influenced civic palette */
1010
--color-navy: #1A4480;
1111
--color-navy-dark: #112F4E;

pnpm-lock.yaml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)