Typography Spacing Review
Typography and spacing review
Executive summary#
The repo has a strong foundation for typography and spacing, but the system is fragmented across shared packages, content/marketing apps, and product/admin apps. Shared token generation exists in packages/config, packages/studio-config, packages/ui, and packages/studio-ui, and several apps already have mature local conventions. However, typography roles, prose defaults, page containers, card density, and compact data-display values are often defined locally instead of through one shared contract.
The highest-impact work is to make existing decisions explicit: define semantic type roles, standardize container and prose rhythm, document product/admin density guidance, and promote repeated raw pixel density values into named tokens. These recommendations are based on the three audit reports in .awao/findings/ and should be implemented incrementally rather than as a broad redesign.
Top cross-repo typography risks#
- No shared semantic type scale. The shared audit found that
packages/config/tailwind.config.jsandpackages/studio-config/tailwind.config.jsdefine font families, but not semantic typography roles. Components assemble hierarchy directly with utilities such astext-xs,text-sm,text-xl, andfont-medium. - Typography ownership is split across many layers. Content apps define type behavior across
apps/docs/styles/main.scss,apps/docs/styles/new-docs.scss,apps/blog/styles/globals.css, MDX CSS, package styles, and route components. Product surfaces similarly split type acrossapps/studio/styles/typography.scss, shadcn primitives, legacypackages/studio-uimodules, and inline Tailwind classes. - Shared pattern classes depend on app-level definitions. The shared audit notes that
heading-title,heading-section, andheading-subSectionare consumed inpackages/ui-patternsbut were not defined in the scoped shared packages inspected, making shared rendering fragile outside Studio. - Font policy differs by surface.
apps/manager/src/globals.cssuses Lato,apps/admin/src/globals.cssuses Inter/system,apps/studio/pages/_app.tsxinjects custom font variables, content apps mix manualcustom-font,next/font, and Inter, and shared config uses additional font-family assumptions. - Prose contracts are inconsistent.
apps/academy/styles/mdx.csshas the strongest long-form prose defaults, whileapps/blog/styles/globals.css,apps/design-system/styles/mdx.css, andapps/ui-library/styles/mdx.cssrely more on imported styles or code-block-focused rules. - Dense UI text lacks a repo-wide readability contract. Product/admin audits found extensive valid use of
text-xs,text-sm,13pxgrid/editor sizing, and metadata text, but these values are not consistently named as density decisions.
Top cross-repo spacing and layout risks#
- Container and page padding contracts overlap. The shared audit cites multiple conventions:
PAGE_SIZE_CLASSESinpackages/ui/src/lib/constants.ts,containerClassesinpackages/ui-patterns/src/layout.ts, andPageContainerusing different padding and max-width behavior. - Spacing tokens exist but direct utilities dominate. Generated CSS exposes
--spacing-xs/sm/md/lg/xl, but components frequently use direct Tailwind utilities and arbitrary values instead of semantic spacing tokens. - Off-scale and hard-coded density values are common. Shared constants include heights such as
h-[26px],h-[34px],h-[38px],h-[42px],h-[50px], while both shared Tailwind wrappers includepadding.content: '21px'. - Card and panel density diverges.
packages/saas-uicards usepx-6/py-6, while legacypackages/studio-ui/src/components/Card/Card.module.cssusespx-8,py-6, andp-8, creating discontinuity near dense Studio tables and panels. - Table layouts favor no-wrap density.
packages/saas-uitables usewhitespace-nowrap; audits note this is useful for dense data but can force horizontal scrolling for long values or multiple row actions in Manager/Admin. - Large-screen readability can exceed comfortable measure. Academy shell tokens expand up to
1200px/1320px; the content audit recommends keeping lesson prose constrained independently to roughly 65–75ch.
Quick wins#
- Move or define the consumed
heading-title,heading-section, andheading-subSectionclasses in a shared stylesheet or replace them with shared class constants inpackages/ui-patterns. - Replace or explicitly justify
padding.content: '21px'inpackages/config/tailwind.config.jsandpackages/studio-config/tailwind.config.js; the shared audit recommends20px/p-5unless the optical offset is intentional. - Align Admin and Manager font policy by resolving the mismatch between
apps/manager/src/globals.cssandapps/admin/src/globals.css. - Add visible labels to placeholder-only Admin dialog forms called out in
apps/admin/src/routes/tenants/index.tsx. - Add page-level headers/descriptions to dense Admin pages such as
apps/admin/src/routes/dashboard.tsx,apps/admin/src/routes/tenants/index.tsx, andapps/admin/src/routes/audit-logs.tsx. - Ensure
apps/ui-libraryuses consistentnext/fontoptions such asdisplay: 'swap'if its font-loading behavior should matchapps/academyandapps/design-system. - Remove or quarantine stale docs styles after confirming usage, especially
apps/docs/styles/Home.module.cssand commented scaffolding inapps/docs/styles/main.scss/apps/docs/styles/new-docs.scss.
Larger follow-up opportunities#
- Create a semantic typography layer. Define roles such as body, label, caption, metadata, page title, section title, subsection title, prose heading, code/detail text, and grid cell text in shared config or CSS.
- Standardize prose defaults for content apps. Share body width, heading margins, line-height, code-block spacing, image rhythm, table behavior, and caption styling across docs, blog, academy, design-system, and ui-library surfaces.
- Choose one page container contract. Consolidate max-width tiers, breakpoint padding, and section vertical rhythm across
packages/ui,packages/ui-patterns, and app-level page shells. - Formalize product/admin density guidance. Document when to use
text-xs,text-sm,text-base,p-2,p-6, wrapping, truncation, compact rows, and action menus for tables/forms/cards. - Promote Studio compact values into named tokens. Keep
fontSize.grid: '13px', MonacofontSize: 13, andtext-[12px]where appropriate, but make them explicit density tokens for grid, code, and metadata contexts. - Add radius and elevation semantics. The shared audit found generated radius tokens and direct shadow utilities, but no clear radius/elevation hierarchy for controls, cards, panels, popovers, modals, and overlays.
- Track arbitrary Tailwind values. A lightweight report could allow Radix/CSS-variable cases while flagging raw pixel widths, heights, and spacing that should become tokens.
Prioritized action plan#
- Stabilize shared primitives first. Define shared heading classes or constants used by
packages/ui-patterns, decide onpadding.content, and document a single container rhythm for shared page primitives. - Write the typography and density contracts. Add a concise shared reference for semantic type roles, product/admin density, text measures, table wrapping/truncation, and card spacing expectations.
- Align high-visibility product surfaces. Resolve Manager/Admin font policy, add Admin page hierarchy and form labels, and audit table action overflow before changing lower-level primitives.
- Unify content prose behavior. Extract or document shared prose defaults for docs/blog/academy/design-system/ui-library, while preserving stronger existing patterns such as
apps/academy/styles/mdx.cssandapps/www/styles/pen-tokens.css. - Normalize Studio-specific compact design. Treat
apps/studio/styles/typography.scssandapps/studio/styles/grid.scssas the source of truth for Studio density, then align legacypackages/studio-uititle/card spacing with that model. - Add ongoing drift checks. Introduce a lightweight arbitrary-value and token-usage report for shared packages and app styles so new raw pixel spacing/type decisions are reviewed deliberately.
Evidence base#
This synthesis is based only on the audit reports at:
.awao/findings/review-typography-spacing-shared-system.md.awao/findings/review-typography-spacing-content-apps.md.awao/findings/review-typography-spacing-product-apps.md