Skip to content

fix: use monospace font in embed chart - #2857

Merged
graphieros merged 1 commit into
mainfrom
embed-chart-font
Jun 5, 2026
Merged

fix: use monospace font in embed chart#2857
graphieros merged 1 commit into
mainfrom
embed-chart-font

Conversation

@graphieros

Copy link
Copy Markdown
Member

Follow up to #2833

Embedded charts currently have the default browser font, which does not convey the npmx design language.
This adds a style tag inside the svg to set the font-family of text elements to monospace.

@vercel

vercelBot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
npmx.devReadyReadyPreview, CommentJun 5, 2026 9:39pm
2 Skipped Deployments
ProjectDeploymentActionsUpdated (UTC)
docs.npmx.devIgnoredIgnoredJun 5, 2026 9:39pm
npmx-lunariaIgnoredIgnoredJun 5, 2026 9:39pm

Request Review

@coderabbitai

coderabbitaiBot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Need the big picture first? Review this PR in Change Stack to see what changed before going file by file.

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: af98baad-98f6-40e1-9c0d-fe72acb06277

📥 Commits

Reviewing files that changed from the base of the PR and between eeacab3 and b0b866d.

📒 Files selected for processing (1)
  • server/utils/embed-downloads-svg.ts

📝 Walkthrough

Summary by CodeRabbit

  • Style
    • Improved text rendering in downloaded SVG files by applying monospace font styling to labels and other text elements.

Walkthrough

An inline CSS style rule is added to the SVG response generator, setting all text elements to render in monospace font within the downloads visualisation.

Changes

SVG text monospace font styling

Layer / File(s)Summary
SVG text monospace styling
server/utils/embed-downloads-svg.ts
The createDownloadsSvgResponse function now injects an inline <style> block (text {font-family:monospace;}) into the SVG markup, applying monospace font rendering to all text elements.

Suggested reviewers

  • danielroe
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check nameStatusExplanation
Title check✅ PassedThe title accurately summarizes the main change: adding monospace font styling to embedded charts.
Description check✅ PassedThe description clearly explains the purpose of the change, references a related issue, and describes the implementation approach.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch embed-chart-font

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecovBot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@graphieros
graphieros requested a review from a teamJune 5, 2026 21:44
@graphieros
graphieros enabled auto-merge June 5, 2026 21:44
@ghostdevv

Copy link
Copy Markdown
Member
Before:After:
imageimage

(my monospace font is Comic Mono)

@graphieros
graphieros added this pull request to the merge queueJun 5, 2026
@ghostdevv

Copy link
Copy Markdown
Member

We could also probably load the Geist font in the SVG

Merged via the queue into main with commit f5c28a4Jun 5, 2026
28 checks passed
@graphieros
graphieros deleted the embed-chart-font branch June 5, 2026 22:11
@github-actionsgithub-actionsBot mentioned this pull request Jun 5, 2026
kimkanu pushed a commit to kimkanu/npmx.dev that referenced this pull request Jun 6, 2026
kimkanu pushed a commit to kimkanu/npmx.dev that referenced this pull request Jun 6, 2026
kimkanu pushed a commit to kimkanu/npmx.dev that referenced this pull request Jun 6, 2026
ayo-run pushed a commit to ayo-run/npmx.dev that referenced this pull request Aug 5, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@graphieros@ghostdevv