Repository navigation
fix(styles): size components in whole design pixels and use one font everywhere - #315
Merged
Merged
Conversation
…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
[Medium impact] The PR appears safe to merge. SummaryReplaces component sizes written in
Reviews (1) · Last reviewed commit: "fix(styles): size components in whole de..." · Reviewed by Greptile |
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.
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
remfor 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:
X rembecomescalc(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-pxis1rem / 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.100dvh - (1.75rem * 2)becomes100dvh - 46pxin design pixels.Drawer.tsx. Noremis left in the built library apart from groudon's own--zap-px.2. One font everywhere
--font-sansis now groudon's Instrument Sans. Toast and progress were still rendering in Geist.@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.
vp run buildandvp run site:buildpass. The built library contains no Geist, no@font-faceand no strayrem.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