Conversation
Detects and classifies fonts (family, role, weights, source, fallbacks) from Google Fonts links, @import rules, @font-face declarations, CSS font-family rules, and external stylesheets. Surfaces results in the dashboard via a new FontDisplay component and in the API response. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
Author
|
TODO:
|
Introduce CONTRIBUTING.md with development workflow, code style, and two new PR requirements: UI screenshots for visual changes and AI model disclosure for transparency. Add GitHub PR template that surfaces these fields automatically when contributors open a pull request. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
FontAssettype withfamily,role,weights,source,fallbacks, and optionalgoogleFontsUrlfields, and extendsBrandExtractionResultto include afontsarrayextractFonts()inscraper.tsusing a multi-phase detection pipeline: Google Fonts<link>tags,@importrules,@font-facedeclarations, CSSfont-familyrules in inline and external stylesheets, and inline element stylesFontDisplayUI component to the dashboard that renders each detected font as a clickable card (copies family name to clipboard) with role, source, and weight metadata/api/extractresponse with logging offontCountFontAssetfrom the public package indexFontAssetcovering family, role, source, weights, fallbacks, andgoogleFontsUrlconsistencyChanges
src/types.ts— newFontAssetinterface;fonts: FontAsset[]added toBrandExtractionResultsrc/scraper.ts—extractFonts()implementation with Google Fonts URL parser, font-stack parser, CSS rule scanner, and heading/body role classifier; also addsAbortSignal.timeout(15_000)to existing fetch callssrc/index.ts— exportsFontAssetcomponents/font-display.tsx— newFontDisplayReact componentcomponents/brand-results.tsx— rendersFontDisplaybetween colors and backdropsapp/api/extract/route.ts— passesfontsthrough to API response and logsfontCountintegration_test/asset-shapes.test.ts—FontAssetshape validation testTest plan
bun test integration_test/asset-shapes.test.tsfontsarray appears in raw JSON view on dashboardFontDisplaycards render correctly and copy-to-clipboard worksfontsarray without errorsImpact
No breaking changes.
fontsis a new additive field onBrandExtractionResult. Existing consumers that do not destructurefontsare unaffected. TheFontAssettype is exported from the package for consumers who want to type the new field.🤖 Generated with Claude Code