Fix note admonition and linked inline-code contrast/consistency - #3371
Open
annakudelska wants to merge 2 commits into
Open
Fix note admonition and linked inline-code contrast/consistency#3371annakudelska wants to merge 2 commits into
annakudelska wants to merge 2 commits into
Conversation
- 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)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- 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
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
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:1danger/warning(red): heading 4.79:1 / 5.53:1, inline-code 4.53:1 / 5.16:1info/callout(neutral): heading 5.28:1 / 9.26:1, inline-code 5.10:1 / 8.18:1prerequisites(neutral): inline-code 5.10:1 / 9.47:1strapi(branded): inline-code 5.20:1 / 5.10:1 — also fixes light-mode inline-code text silently rendering asneutral-800instead of primary blue (base rule wires code color toheading-color, notcode-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: borderneutral-200(light) / light-modeneutral-500hex @20% (dark, since the dark-mode token resolves much lighter)Bug fixes (unrelated to contrast, found while auditing)
warningadmonition type used red (danger) colors in light mode but orange (caution) colors in dark mode — now consistently red in both, matchingdanger.neutral-150/neutral-800) thaninfo/subtle/prerequisites(neutral-100/neutral-600) — unified to one grey.note's primary values.Carried over from the previous update
ph-link),font-weight: 400instead of bold,border-width: 1px(previously0.1rem/1.6px via Infima's default) to match the1pxadmonition border.Test plan
yarn buildpasses locally (client + server compiled successfully)caution's off-palette#CA3500and on the general tint/opacity levels🤖 Generated with Claude Code