惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 三生石上(FineUI控件)
月光博客
月光博客
人人都是产品经理
人人都是产品经理
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence
Vercel News
Vercel News
MyScale Blog
MyScale Blog
爱范儿
爱范儿
博客园 - 司徒正美
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
IT之家
IT之家
H
Help Net Security
Last Week in AI
Last Week in AI
阮一峰的网络日志
阮一峰的网络日志
酷 壳 – CoolShell
酷 壳 – CoolShell
L
LangChain Blog
罗磊的独立博客
Stack Overflow Blog
Stack Overflow Blog
宝玉的分享
宝玉的分享
博客园 - 聂微东
云风的 BLOG
云风的 BLOG
J
Java Code Geeks
博客园 - 叶小钗
D
Docker

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I ran my own tool against 100 sites. 1 in 5 returned the ...
Yuvraj Angad · 2026-05-17 · via DEV Community
Cover image for I ran my own tool against 100 sites. 1 in 5 returned the wrong primary font.

Yuvraj Angad Singh

I built brandmd 6 months ago. It is an npm CLI that extracts any website's design system into a DESIGN.md file. The idea: drop the file in your project root, AI coding agents (Claude Code, Cursor, Gemini CLI, Stitch) read it, and they generate on-brand UI instead of generic shadcn-default.

It was working. Stripe, GitHub, Vercel, Linear — primary fonts came back correct. Then a user DMd me last week.

"your tool says my primary font is Inter. it is actually Manrope. the brand is on the hero, not the paragraphs."

Fair. So I ran brandmd against 100 popular design system sites to see how widespread the bug was.

The result

9 of 45 successfully-extracted sites returned the wrong Primary font. 20%.

Site brandmd said Reality
mantine.dev Menlo Outfit
remix.run JetBrains Mono Inter Variable
neon.tech GeistMono Inter
valura.ai Inter Manrope
railway.app Inter IBM Plex Serif (on the hero)
resend.com inter aBCFavorit
svelte.dev Georgia DM Serif Display
workday.design Times (no real brand font, fallback)
htmx.org Times (intentionally minimal)

Three different failure modes:

  1. Code fonts winning. mantine and remix had so much code on their homepage that JetBrains Mono / Menlo dominated the font frequency count.
  2. Body text drowning the brand. valura uses Inter on 737 elements (utility), Manrope on 28 (hero). Frequency rank picks Inter.
  3. Fallback Times. Sites with no custom font load Playwright's default fallback. Old logic surfaced Times as Primary.

Root cause

// analyze.js, v0.7.2
const primaryFont = fontList[0]?.[0];

Enter fullscreen mode Exit fullscreen mode

That was it. Primary was just the most-frequent font across all DOM elements. Body text always wins.

The fix (v0.8, just shipped)

// analyze.js, v0.8
const primaryFont =
  pickNonExcluded(displayFonts) ||  // fontSize >= 40px (hero)
  pickNonExcluded(headingFonts) ||  // h1-h6
  pickNonExcluded(bodyFonts) ||     // p, li, span, div
  fontList[0]?.[0];

// excluded from Primary: mono fonts (Menlo, JetBrains Mono, GeistMono, etc.),
// default fallbacks (Times, Arial, Georgia), icon fonts (Material Icons,
// Font Awesome, Heroicons).

Enter fullscreen mode Exit fullscreen mode

Three principles:

  1. Display first. The hero font is the brand font. fontSize >= 40px is where the brand lives, not in h2/h3 subtitles.
  2. Skip mono. Code fonts can win Secondary slot, never Primary. mantine.dev wants Outfit on top, JetBrains Mono in code blocks.
  3. Skip fallbacks. If the site has no real custom font, surfacing Times honestly is fine. But if there ARE real fonts available, use those.

Also shipped:

  • Quote-aware font-family parser (handles var(--font, 'Inter') and backslash escapes that v0.7.2 split incorrectly)
  • Per-role cascade (heading falls back to display falls back to body)
  • Navigation timeout 30s → 45s for slow SPAs

Results

7 of 9 wrong-Primary cases now report the correct brand font. The remaining 2 (railway.app, workday.design) genuinely have no distinct brand font on the hero, so the output is honest.

Install

npm i brandmd
# or run without install
npx brandmd https://your-site.com

Enter fullscreen mode Exit fullscreen mode

Repo: github.com/yuvrajangadsingh/brandmd

If brandmd saved you time, star the repo — it helps other devs find it.