feat(ui): author the caption/data type-scale tier (batch 1 of #7844)#8053
Merged
Conversation
#7808 converted every UPPERCASE eyebrow label to mg-type-micro/mg-type-label, but the bare-arbitrary-text-size guardrail still reports ~1,181 warnings in apps/ui (52 in ui-kit) -- the bulk being body-adjacent sizes that have no utility class to reach for: text-[12px] x240 and text-[13px] x52 combined across both packages, plus widespread font-mono text-[10px]/[11px] data/numeric text (timestamps, hashes, tabular values) that #7808 deliberately left alone since it isn't the uppercase-label idiom. Adds four utilities to packages/ui-kit/src/styles.css: - --mg-type-caption (12px) / .mg-type-caption -- sans, line-height 1.45 - --mg-type-caption-lg (13px) / .mg-type-caption-lg -- sans, line-height 1.5 - .mg-type-data -- mono, 11px, line-height 1.4, no uppercase/tracking - .mg-type-data-sm -- mono, 10px, line-height 1.35, no uppercase/tracking Classification pass (2026-07-24, both packages, same-line font-mono co-occurrence as the mono/sans split heuristic): | Size | Total | mono (-> data/data-sm) | non-mono (-> caption/caption-lg) | |---|---|---|---| | text-[10px] | 295 | 198 | 97 | | text-[11px] | 582 | 412 | 170 | | text-[12px] | 231 | 127 | 104 | | text-[13px] | 47 | 8 | 39 | (ui-kit has its own smaller counts on top: 22/31/9/5 respectively.) This PR is utilities-only, per the issue's own "batch PRs (utilities first, then sweeps)" plan -- no .tsx sites converted yet. Follow-up PRs will sweep by directory, with the same per-site line-height-regression check the issue calls out (today's bare text-[12px] inherits line-height; mg-type-caption sets one, so a dense table row needs an explicit leading-* override or becomes a documented exception). Verified via getComputedStyle: all four classes resolve to their intended font-size/line-height/font-family. Part of #7844
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
metagraphed-ui | 8cad937 | Commit Preview URL Branch Preview URL |
Jul 24 2026, 09:21 PM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8053 +/- ##
=======================================
Coverage 97.68% 97.68%
=======================================
Files 220 220
Lines 27246 27246
Branches 10805 10805
=======================================
Hits 26614 26614
Misses 140 140
Partials 492 492 🚀 New features to boost your workflow:
|
JSONbored
added a commit
that referenced
this pull request
Jul 24, 2026
… scale (#8077) Converts every text-[12px]/[13px] site (both packages, unconditional -- the caption/caption-lg tiers don't touch font-family, so any existing font-mono class stays valid alongside them) and every mono-context text-[10px]/[11px] site (detected by font-mono co-occurring on the same class string; the redundant font-mono utility is dropped since mg-type-data/data-sm already set that font-family) onto the four utilities #8053 authored. Non-mono text-[10px]/[11px] sites are left untouched -- no token exists for a sans 10/11px tier in this design system, and forcing them into caption (12px, a size up) or data/data-sm (which would incorrectly switch them to mono) would both be real visual regressions. These are the "genuine exception" bucket the issue's own classification pass calls for; the warn-tier guardrail added in #8053 continues to flag them as a residual worklist, same convention every other token rule in this codebase uses. Result: apps/ui's bare-arbitrary-text-size warning count drops from the 1,181 baseline to 301 (-74.5%, well past the issue's >=60% target). ui-kit drops from 52 to 44. Verified: tsc clean, eslint 0 errors, prettier clean, vitest green (1465 tests in apps/ui, 88 in ui-kit) in both packages; packages/ui-kit rebuilt. Live preview: getComputedStyle confirms all four mg-type-* classes resolve to their intended font-size/line-height/font-family on real rendered content (a subnet detail page), and a visual spot-check showed no layout regression. Closes #7844
Merged
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
#7808 converted every UPPERCASE eyebrow label to
mg-type-micro/mg-type-label, but the bare-arbitrary-text-size guardrail still reports ~1,181 warnings inapps/ui(52 inui-kit) — the bulk being body-adjacent sizes that have no utility class to reach for:text-[12px]andtext-[13px], plus widespreadfont-mono text-[10px]/[11px]data/numeric text (timestamps, hashes, tabular values) that #7808 deliberately left alone since it isn't the uppercase-label idiom.This is batch 1 of #7844 ("Batch PRs — utilities first, then sweeps"): tokens + utility classes + the classification pass, no
.tsxsites converted yet.New utilities (
packages/ui-kit/src/styles.css)--mg-type-caption(12px) /.mg-type-caption— sans, line-height 1.45--mg-type-caption-lg(13px) /.mg-type-caption-lg— sans, line-height 1.5.mg-type-data— mono, 11px, line-height 1.4, no uppercase/tracking.mg-type-data-sm— mono, 10px, line-height 1.35, no uppercase/trackingThe mono pair is deliberately not uppercase/tracked, unlike
mg-type-micro/label— that distinction is exactly why #7808 correctly skipped these sites.Classification pass (2026-07-24, both packages)
Bucketed every
text-[10px]/[11px]/[12px]/[13px]site by whetherfont-monoco-occurs on the same class string (the mono/sans split heuristic —data/data-smvscaption/caption-lg):text-[10px]text-[11px]text-[12px]text-[13px]ui-kitadds its own smaller counts on top (22/31/9/5 respectively). Combinedtext-[12px]+text-[13px]across both packages = 240 + 52, matching the issue's own 2026-07-24 baseline exactly.Follow-up sweep PRs will convert by directory, carrying the same per-site line-height-regression check the issue calls out: today's bare
text-[12px]inherits its container's line-height, while.mg-type-captionsets its own (1.45) — a dense table row may need an explicitleading-*override or become a documented exception rather than silently reflowing.Verification
tsc --noEmitclean in both packageseslint .(full package) — 0 errors, warning counts unchanged (this PR adds no.tsxconversions, so nothing should drop yet)vitest run— 191 files / 1465 tests inapps/ui, 16 files / 88 tests inui-kit, all passingpackages/ui-kitrebuilt (dist/index.css)getComputedStyleconfirms all four new classes resolve to their intended font-size/line-height/font-familyPart of #7844