refactor(ui): sweep text-[10-13px] arbitrary sizes onto the mg-type-* scale#8077
Merged
Conversation
… scale 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
|
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 | aa0dd61 | Commit Preview URL Branch Preview URL |
Jul 24 2026, 10:01 PM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8077 +/- ##
=======================================
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:
|
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
Follow-up to #8053 (the caption/data type-scale tokens). Sweeps every
text-[10px]/[11px]/[12px]/[13px]site across both packages onto the new.mg-type-caption/-caption-lg/-data/-data-smutilities.Conversion rules
text-[12px]→mg-type-caption,text-[13px]→mg-type-caption-lg— unconditional, both packages. Neither utility touchesfont-family, so any existingfont-monoclass on the same element stays valid and unaffected.text-[10px]/[11px]→mg-type-data-sm/mg-type-data— only wherefont-monoco-occurs on the same class string (the mono-context detection the issue's classification pass calls for). The now-redundantfont-monoutility is dropped since the token already sets that font-family.text-[10px]/[11px]withoutfont-mono— left untouched. No token in this scale covers a sans 10/11px tier; forcing them intocaption(a size up) ordata/data-sm(which would wrongly switch them to mono) would both be real visual regressions. This is the issue's own "genuine exception" bucket — the warn-tier guardrail from feat(ui): author the caption/data type-scale tier (batch 1 of #7844) #8053 still flags these as a residual worklist, same convention every other token rule in this codebase already uses.Result
apps/uibare-arbitrary-text-size warnings: 1,181 → 301 (-74.5%, past the issue's ≥60% target)packages/ui-kit: 52 → 44text-[12px]/text-[13px]count: 0 outside documented exceptions (there are none — both sizes convert unconditionally)Verification
tsc --noEmitclean in both packageseslint .(full package) — 0 errors in bothprettier --check .clean (37 files needed a targeted--writeafter the sweep shortened lines enough to change wrapping — no semantic changes, pure reformat)vitest run— 191 files / 1465 tests inapps/ui, 16 files / 88 tests inui-kit, all passingpackages/ui-kitrebuilt (dist/index.{js,cjs,css})getComputedStyleconfirms all fourmg-type-*classes resolve to their intended font-size/line-height/font-family on real rendered content (a subnet detail page); visual spot-check showed no layout regressionCloses #7844