Skip to content

chore(storybook): DS base typography on the story canvas (deliberate re-baseline)#151

Merged
dgraciac merged 1 commit into
mainfrom
chore/storybook-ds-base-typography
Jul 11, 2026
Merged

chore(storybook): DS base typography on the story canvas (deliberate re-baseline)#151
dgraciac merged 1 commit into
mainfrom
chore/storybook-ds-base-typography

Conversation

@dgraciac

Copy link
Copy Markdown
Member

Qué

La tarea que priorizamos tras el Checkbox. Storybook renderizaba el texto heredado en su fuente por defecto: los componentes Pharos fijan su propio font-family, pero el texto crudo (un <label>) y cualquier elemento que solo hereda caían a la default de Storybook → Chromatic los snapshotaba con la tipografía equivocada.

Cambio (solo Storybook)

  • Regla #storybook-root en preview.css con la tipografía base del DS (font-family sans + 14/20 + neutral-900), acotada al canvas (docs = #storybook-docs intactos). Simula un consumidor real que fija la tipografía del DS como base (por D8/D9 la tipografía la pone el consumidor).
  • Elimina el decorator por-story del Checkbox (ya redundante).

⚠️ Re-baseline deliberado (acción tuya)

Esto re-baselina ~50 snapshots de Chromatic: cambia la tipografía y el color del texto heredado en las stories de casi todos los componentes. No hay cambio de comportamiento.

Qué hacer al revisar en Chromatic: confirmar que los diffs son solo tipografía/color (Outfit + 14/20 + neutral-900 en el texto heredado) y aceptarlos conscientemente. Si ves algún diff que NO sea tipográfico (layout roto, solape, recorte), páralo y avísame.

Nota de diseño (posible follow-up)

Esto asume el contrato "el consumidor fija la tipografía base" (como hace examples/saas-demo desde #149). Alternativa más robusta a evaluar aparte: que cada componente que hoy hereda fije su propio font-family, para consumidores que no pongan base. No en esta PR.

Verificación

typecheck · test:storybook a11y (99) · build-storybook — verdes. Storybook-only, sin changeset.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AgnovjGivnndpV7Yzt6AmY

Deliberate, standalone re-baseline (the follow-up flagged when Checkbox's
first raw-text story exposed this). Storybook rendered inherited text in
its own default font because nothing set a base on the canvas; Pharos
components set their own font, but raw markup and font-inheriting elements
fell back to Storybook's default — so Chromatic snapshotted them in the
wrong typeface.

- Add a `#storybook-root` rule in preview.css: DS base type (font-family
  sans + 14/20 + neutral-900), scoped to the canvas so docs
  (#storybook-docs) are untouched. Mirrors a real consumer that sets the
  DS type as its base (per D8/D9 the consumer provides typography).
- Drop the now-redundant per-story decorator from Checkbox.stories.

Consequence: ~50 Chromatic snapshots re-baseline (typography/color of
inherited text only — no behaviour change). REQUIRES reviewing the diffs
and accepting them knowingly.

Storybook-only (never bundled, D9). No changeset. typecheck +
test:storybook a11y (99) + build-storybook green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AgnovjGivnndpV7Yzt6AmY
@chromatic-com

chromatic-com Bot commented Jul 11, 2026

Copy link
Copy Markdown

Tip

All tests passed and all changes approved!

🟢 UI Tests: 49 visual and accessibility changes accepted as baselines
🟢 UI Review: Approved by David Gracia
Storybook icon Storybook Publish: 99 stories published

@dgraciac
dgraciac merged commit e1841e4 into main Jul 11, 2026
12 checks passed
@dgraciac
dgraciac deleted the chore/storybook-ds-base-typography branch July 11, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant