generate Inter font-face rules (with fallback font) and preloads (with vite-font)#1041
generate Inter font-face rules (with fallback font) and preloads (with vite-font)#1041rishi-raj-jain wants to merge 6 commits into
Conversation
📝 WalkthroughWalkthroughConfigures ChangesInter font loading
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ViteConfig
participant ViteFont
participant RootRoute
participant Browser
ViteConfig->>ViteFont: Configure Inter font faces and subsets
ViteFont-->>RootRoute: Provide fontPreloads and fontCss
RootRoute->>Browser: Render preload links and inline font CSS
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/styles/app.css (1)
24-29: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winQuote
Segoe UI Symbolto resolve Stylelintvalue-keyword-caseerrors.Stylelint flags three
value-keyword-caseerrors on line 29:Segoe,UI, andSymbolare expected to be lowercase because the font name is unquoted. All other multi-word font names in the stack are quoted ('Apple Color Emoji','Segoe UI Emoji','Noto Color Emoji'). QuoteSegoe UI Symbolfor consistency and to resolve the lint errors.♻️ Proposed fix
--font-sans: 'Inter', 'Inter Fallback', ui-sans-serif, system-ui, sans-serif, - 'Apple Color Emoji', 'Segoe UI Emoji', Segoe UI Symbol, 'Noto Color Emoji'; + 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/styles/app.css` around lines 24 - 29, Quote the unquoted Segoe UI Symbol font name in the --font-sans declaration, matching the existing quoted multi-word font names and resolving the value-keyword-case lint errors.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/styles/app.css`:
- Around line 24-29: Quote the unquoted Segoe UI Symbol font name in the
--font-sans declaration, matching the existing quoted multi-word font names and
resolving the value-keyword-case lint errors.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 50f74e53-000a-43d9-8dba-30303e7642d9
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (5)
package.jsonsrc/routes/__root.tsxsrc/styles/app.csssrc/tanstack-start.d.tsvite.config.ts
vite-fontand wires it intovite.config.ts, so Inter's@font-facerules, its preload link, and a metric-matchedInter Fallbackfamily are all generated at build time from the woff2 files and consumed in__root.tsxviavirtual:vite-font, replacing the hand-written copies inapp.cssand the hardcoded preload href.Disclaimer: I'm the author of vite-font package
Summary by CodeRabbit