Skip to content

Commit 7402804

Browse files
authored
🤖 feat: add Geist font for Windows/Linux (#580)
This PR updates the font configuration to use San Francisco on macOS and Geist on Windows/Linux. ## Changes - Installed `geist` package and bundled Geist Sans and Geist Mono variable fonts - Added @font-face declarations for both fonts in `globals.css` - Updated `--font-primary` to prefer `-apple-system` (San Francisco) first, then fall back to `Geist` - Updated `--font-monospace` to prefer macOS system monospace fonts, then `Geist Mono` ## Implementation The font-family stack now works as follows: - **macOS**: Uses `-apple-system` (San Francisco) for UI and `Monaco`/`Menlo` for monospace - **Windows/Linux**: Falls through to `Geist` for UI and `Geist Mono` for monospace Font files are bundled in `public/fonts/` and loaded with `font-display: swap` for better performance. _Generated with `mux`_
1 parent 005e43a commit 7402804

File tree

8 files changed

+133
-7
lines changed

8 files changed

+133
-7
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Font files (copied from node_modules during build)
2+
public/fonts/
3+
14
# OSX
25
.DS_Store
36

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ build-renderer: node_modules/.installed src/version.ts ## Build renderer process
145145
build-static: ## Copy static assets to dist
146146
@echo "Copying static assets..."
147147
@mkdir -p dist
148+
@./scripts/copy-fonts.sh
148149
@cp static/splash.html dist/splash.html
149150
@cp -r public/* dist/
150151

bun.lock

Lines changed: 86 additions & 1 deletion
Large diffs are not rendered by default.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
"eslint-plugin-react-hooks": "^5.2.0",
127127
"eslint-plugin-storybook": "10.0.0",
128128
"eslint-plugin-tailwindcss": "4.0.0-beta.0",
129+
"geist": "^1.5.1",
129130
"jest": "^30.1.3",
130131
"mermaid": "^11.12.0",
131132
"nodemon": "^3.1.10",
56.7 KB
Binary file not shown.
57.1 KB
Binary file not shown.

scripts/copy-fonts.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
# Copy Geist fonts from node_modules to public/fonts
3+
set -euo pipefail
4+
5+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6+
PROJECT_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
7+
8+
mkdir -p "${PROJECT_ROOT}/public/fonts/geist-sans"
9+
mkdir -p "${PROJECT_ROOT}/public/fonts/geist-mono"
10+
11+
# Copy variable fonts (support weights 100-900)
12+
cp "${PROJECT_ROOT}/node_modules/geist/dist/fonts/geist-sans/Geist-Variable.woff2" \
13+
"${PROJECT_ROOT}/public/fonts/geist-sans/"
14+
15+
cp "${PROJECT_ROOT}/node_modules/geist/dist/fonts/geist-mono/GeistMono-Variable.woff2" \
16+
"${PROJECT_ROOT}/public/fonts/geist-mono/"
17+
18+
echo "✓ Copied Geist variable fonts to public/fonts/"

src/styles/globals.css

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
@import "tailwindcss";
22
@source "../node_modules/streamdown/dist/index.js";
33

4+
/* Geist Font Declarations */
5+
@font-face {
6+
font-family: "Geist";
7+
src: url("/fonts/geist-sans/Geist-Variable.woff2") format("woff2");
8+
font-weight: 100 900;
9+
font-style: normal;
10+
font-display: swap;
11+
}
12+
13+
@font-face {
14+
font-family: "Geist Mono";
15+
src: url("/fonts/geist-mono/GeistMono-Variable.woff2") format("woff2");
16+
font-weight: 100 900;
17+
font-style: normal;
18+
font-display: swap;
19+
}
20+
421
@theme {
522
/* Mode Colors */
623
--color-plan-mode: hsl(210 70% 40%);
@@ -205,15 +222,16 @@
205222
--color-token-cached: hsl(0 0% 50%);
206223

207224
/* Font Variables */
208-
/* Primary UI Font - System fonts for best native appearance */
225+
/* Primary UI Font - San Francisco on macOS, Geist on Windows/Linux */
209226
--font-primary:
210-
system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial,
211-
sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
227+
-apple-system, BlinkMacSystemFont, "Geist", system-ui, "Segoe UI", "Roboto",
228+
"Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
229+
"Segoe UI Symbol";
212230

213-
/* Monospace Font - Code and technical content */
231+
/* Monospace Font - System monospace on macOS, Geist Mono on Windows/Linux */
214232
--font-monospace:
215-
"Monaco", "Menlo", "Ubuntu Mono", "Consolas", "Courier New", monospace, "Apple Color Emoji",
216-
"Segoe UI Emoji", "Segoe UI Symbol";
233+
"Monaco", "Menlo", "Geist Mono", "Ubuntu Mono", "Consolas", "Courier New", monospace,
234+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
217235
}
218236

219237
body {

0 commit comments

Comments
 (0)