Skip to content

feat(theme): lighten heading and body type, and align the Message icon to the first line - #876

Open
gabriel-lisboa-azion wants to merge 3 commits into
mainfrom
fix/message-icon-align-type-weights
Open

feat(theme): lighten heading and body type, and align the Message icon to the first line#876
gabriel-lisboa-azion wants to merge 3 commits into
mainfrom
fix/message-icon-align-type-weights

Conversation

@gabriel-lisboa-azion

Copy link
Copy Markdown
Collaborator

Summary

  • text-heading-* and every text-body-* step drop from weight 400 to 300, and the body steps tighten from 1.5 to 1.375 leading; text-tag-* drops from 600 to 400. The four body steps plus text-body-xxs now emit a --text-*-font-weight custom property they previously lacked, so the utilities set a weight instead of inheriting one.
  • Message kept its icon on the root's items-center row, so wrapped copy dragged the icon to the vertical middle of the block. The icon and the copy now share an items-start block, with the icon on an alignment box the height of the copy's line box (h-5.25 medium / h-4.5 small).
  • packages/theme/dist/v4/* and packages/webkit/catalog.json are regenerated from the token sources.

How to test

  1. pnpm --filter @aziontech/webkit test -- src/components/feedback/message/message.test.ts → 33 passing.
  2. pnpm storybook:dev, open Components/Feedback/Message. Widen the label until it wraps to two lines at both small and medium: the icon stays beside the first line instead of drifting to the middle. Measured line boxes are 21px (medium, text-label-md) and 18px (small, text-label-sm), matching the alignment box.
  3. In the same Storybook, check Foundations/Typography: headings and body copy render at 300, tags at 400, and body steps sit on 1.375 leading.
  4. cd packages/theme && node src/scripts/build-tokens.mjs then git diff --exit-code packages/theme/dist → no drift. Same for pnpm --filter @aziontech/webkit run catalog:check.

Notes

  • Not breaking: no token is renamed or removed. The added --text-body-*-font-weight properties are new surface, hence the feat type.
  • The typography change alters rendered weight system-wide, so the visual-regression baselines will need regenerating once CI reports the diff — baselines are CI-only.

Headings (2xl → xxs) and every body step now render at 300 instead of
400, and the body steps tighten from 1.5 to 1.375 leading. The four
`text-body-*` steps plus `text-body-xxs` gain a `--text-*-font-weight`
custom property that did not exist before, so the utilities emit a
weight rather than inheriting one. Tag steps drop from 600 to 400.

`text-body-xxs` moves next to its siblings so the generated block reads
in order; `dist/v4` and the webkit token catalog are regenerated.
The icon and the copy were siblings of the root's `items-center` row, so
a message whose text wrapped to two or more lines drifted the icon to
the vertical middle of the block instead of leaving it beside the first
line.

The icon and the copy now share an `items-start` block, and the icon
rides an alignment box the height of the copy's line box — `h-5.25`
(21px) at medium, `h-4.5` (18px) at small — so it centers on the first
line and stays there at any wrap depth.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant