Skip to content

Fix note admonition and linked inline-code contrast/consistency - #3371

Open
annakudelska wants to merge 2 commits into
repo/summer-2026-redesign-all-componentsfrom
repo/summer-2026/anka-fixes
Open

Fix note admonition and linked inline-code contrast/consistency#3371
annakudelska wants to merge 2 commits into
repo/summer-2026-redesign-all-componentsfrom
repo/summer-2026/anka-fixes

Conversation

@annakudelska

@annakudelska annakudelska commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Contrast/readability pass on the redesigned admonition and inline-code components (see the design showcase preview). Now covers every admonition variant, not just note.

Per-variant colors (light: tinted bg @60%, full-strength border/inline-code; dark: bg @6%, border @12%, inline-code bg @6%/border @20%)

  • note (blue): heading 5.46:1 / 5.32:1, inline-code 5.20:1 / 4.99:1 (light/dark)
  • tip/success (green): heading 4.66:1 / 6.94:1, inline-code 4.51:1 / 6.41:1
  • danger/warning (red): heading 4.79:1 / 5.53:1, inline-code 4.53:1 / 5.16:1
  • info/callout (neutral): heading 5.28:1 / 9.26:1, inline-code 5.10:1 / 8.18:1
  • prerequisites (neutral): inline-code 5.10:1 / 9.47:1
  • strapi (branded): inline-code 5.20:1 / 5.10:1 — also fixes light-mode inline-code text silently rendering as neutral-800 instead of primary blue (base rule wires code color to heading-color, not code-color)
  • caution (orange): dark mode passes (8.27:1 / 7.52:1). Light mode does not fully meet 4.5:1 with any palette token — warning-700, the darkest available shade, tops out at ~4.0:1 against the caution background. Ships with #CA3500 (6.96:1 / 6.72:1, comfortably over AA), which is not tied to any palette token — design-approved.
  • subtle: border neutral-200 (light) / light-mode neutral-500 hex @20% (dark, since the dark-mode token resolves much lighter)

Bug fixes (unrelated to contrast, found while auditing)

  • The warning admonition type used red (danger) colors in light mode but orange (caution) colors in dark mode — now consistently red in both, matching danger.
  • Inline code inside tables used a different grey (neutral-150/neutral-800) than info/subtle/prerequisites (neutral-100/neutral-600) — unified to one grey.
  • Default (non-admonition) inline code rendered white in dark mode instead of the intended primary blue — now matches note's primary values.

Carried over from the previous update

  • All inline code wrapped in a link: link icon (Phosphor ph-link), font-weight: 400 instead of bold, border-width: 1px (previously 0.1rem/1.6px via Infima's default) to match the 1px admonition border.

Test plan

  • yarn build passes locally (client + server compiled successfully)
  • Verified light and dark mode rendering on a local design-showcase page covering every admonition variant and inline-code context
  • Computed WCAG contrast ratios for every variant/mode pair (see above)
  • Design sign-off on caution's off-palette #CA3500 and on the general tint/opacity levels

🤖 Generated with Claude Code

- note admonition: rework background/border/inline-code colors in both
  light and dark mode so text meets WCAG AA (4.5:1) against their
  backgrounds
- all inline code wrapped in a link: prepend a link icon (Phosphor),
  reduce font-weight from bold to regular, and normalize the border
  width to 1px to match admonition borders (previously 1.6px via
  Infima's default)
@annakudelska
annakudelska requested a review from pwizla as a code owner August 4, 2026 12:03
@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
documentation Ready Ready Preview Aug 10, 2026 1:49pm

Request Review

- tip/success, caution, danger/warning, info/callout, strapi, subtle,
  prerequisites: rework background/border/inline-code colors in both
  light and dark mode, following the same pattern established for the
  note admonition (light: tinted bg @60%, full-strength borders/code-bg;
  dark: @6%/@12%/@20% opacity layers)
- fix a pre-existing bug where the `warning` admonition type used
  red (danger) colors in light mode but orange (caution) colors in
  dark mode — now consistently red/danger in both themes
- unify inline-code-in-tables to the same neutral grey as
  info/subtle/prerequisites, instead of a separate, different grey
- fix default (non-admonition) inline code in dark mode rendering
  white instead of the intended primary blue
- caution text color in light mode uses a custom #CA3500 (darker than
  the darkest available warning-700 token) since even warning-700
  falls short of WCAG AA against the caution background
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