Skip to content

fix(styles): size components in whole design pixels and use one font everywhere - #315

Merged
sohhamm merged 1 commit into
mainfrom
fix/component-sizes-design-px
Nov 4, 2026
Merged

sohhamm merged 1 commit into
mainfrom
fix/component-sizes-design-px

Conversation

@sohhamm

@sohhamm sohhamm commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #314 (PSD-3901). It ships the two visible fixes that #314 deliberately left out.

1. Component sizes in 16px apps

Charizard's component CSS was written in rem for the console's 13px root. In the 16px-root apps (zenex, ops dashboard, vendor portal) every component therefore rendered about 19% too large: layout tabs at 17.28px instead of 14px, and drawers at 492px instead of 400px.

The math:

  • Each X rem becomes calc(N * var(--zap-px)), where N = X × 13, rounded to the nearest whole design pixel. Halves round to the even number, so 6.5 becomes 6.
  • --zap-px is 1rem / var(--zap-base-font-size). On the console (base 13) that gives N × 1rem/13, which is the size it had before, within 1px. In 16px apps it gives exactly N px, the designed size.
  • Two drawer widths snap to their scale: 46.2rem (600.6px) becomes 600 and 77rem (1001px) becomes 1000. The full drawer scale is 400/600/820/1000/1200.
  • The drawer's 100dvh - (1.75rem * 2) becomes 100dvh - 46px in design pixels.
  • In total, 87 values across 15 CSS files and Drawer.tsx. No rem is left in the built library apart from groudon's own --zap-px.

2. One font everywhere

  • The library's --font-sans is now groudon's Instrument Sans. Toast and progress were still rendering in Geist.
  • The showcase site (ui.zenadmin.co) loads Instrument Sans from the same Google Fonts link the apps use.
  • Geist and its @fontsource-variable/geist* packages are removed. --font-mono (used by code blocks) falls back to the system monospace stack.

Verification

I compared the 4.0.0 build against this branch on the showcase site, covering all 40 component pages. Headless Chrome measured every rendered element: font size, line height, weight, font family, and x/y/w/h.

  • 13px root (console): 38 of 40 components are identical. Upload and progress move by less than 0.8px because of whole-number rounding (9.75 → 10, 36.4 → 36).
  • 16px root (zenex, ops, vendor portal): the intended changes appear. Layout tabs go from 17.28px to 14px, progress, upload and empty-state spacing shrinks to design size, and the color-picker error text goes from 16px to 13px. Loader differences are just its animation.
  • vp run build and vp run site:build pass. The built library contains no Geist, no @font-face and no stray rem.

Needs design QA on staging after the app bumps: zenex, the ops dashboard and the vendor portal. Their drawers, inputs, switches, date pickers and layout tabs will look smaller, at their Figma sizes.

🤖 Generated with Claude Code

https://claude.ai/code/session_018ri6pg6Efkt62EvvHpoEbY

…everywhere

Component CSS was authored in rem against the console's 13px root, so in the
16px-root apps (zenex, ops dashboard, vendor portal) every component rendered
~19% too large (layout tabs at 17.28px instead of 14px, drawers 492px instead
of 400px).

- Every rem value becomes calc(N * var(--zap-px)) where N = rem x 13, rounded
  to the nearest whole design pixel (ties to even: 6.5 -> 6). On the console's
  13px root that is the same size it had (within 1px); in 16px apps it is now
  the designed size. Two drawer widths snap to their scale (600.6 -> 600,
  1001 -> 1000).
- The drawer height calc uses the same 46 design px.
- One font everywhere: the library's --font-sans is groudon's Instrument Sans
  (toast and progress were still Geist), and the showcase site (ui.zenadmin.co)
  loads Instrument Sans like the apps do. Geist and its fontsource packages are
  removed; --font-mono falls back to the system monospace stack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ri6pg6Efkt62EvvHpoEbY
@greptile-apps

greptile-apps Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Replaces component sizes written in rem with rounded design pixels through --zap-px.

  • Component sizes now follow whole design-pixel steps.
  • Charizard’s sans text now uses the product font everywhere.

Reviews (1) · Last reviewed commit: "fix(styles): size components in whole de..." · Reviewed by Greptile

@sohhamm
sohhamm merged commit 5a5058b into main Nov 4, 2026
2 checks passed
@sohhamm
sohhamm deleted the fix/component-sizes-design-px branch November 4, 2026 11:02
Sign up for free to 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.

1 participant