Skip to content

fix(docs): restore inline code contrast in light mode#3365

Merged
dgageot merged 1 commit into
mainfrom
fix/docs-inline-code-contrast
Jul 1, 2026
Merged

fix(docs): restore inline code contrast in light mode#3365
dgageot merged 1 commit into
mainfrom
fix/docs-inline-code-contrast

Conversation

@aheritier

Copy link
Copy Markdown
Contributor

Inline code spans like opencode-zen and OPENCODE_API_KEY were nearly invisible in light mode: light gray text (#C8CFDA) on a near-white background (#F6F8FA).

Root cause: Kramdown+Rouge tags inline code with class="language-plaintext highlighter-rouge". The Rouge block-code override selector .content code[class*="language-"] matched these spans and forced the low-contrast colours.

Fix: Scope the selector to .content pre code[class*="language-"]. Inline code now falls back to .content code, which in light mode renders as blue-600 (#1A4DD9) on white (#FFFFFF) with a visible border — the site's existing design intent. Dark mode and block code are unaffected.

Testing: Go build ✓, custom linter ✓, go mod tidy ✓. CSS change only.

Kramdown+Rouge tags inline `code` spans with
`class="language-plaintext highlighter-rouge"`.  The Rouge block-code
override selector `.content code[class*="language-"]` was catching
these spans and forcing `color: var(--gray-200)` (#C8CFDA, light gray)
on a near-white `--bg-code-block` background (#F6F8FA) — nearly
invisible in light mode.

Scope the selector to `.content pre code[class*="language-"]` so it
only matches code inside block `<pre>` elements.  Inline code now falls
back to `.content code`, which in light mode renders as
`--text-code` (blue-600, #1A4DD9) on `--bg-code` (#FFFFFF) with a
visible border — clear contrast, matching the site's existing design
intent.
@aheritier aheritier requested a review from a team as a code owner July 1, 2026 11:42
@dgageot dgageot merged commit e3a240a into main Jul 1, 2026
13 checks passed
@rumpl rumpl deleted the fix/docs-inline-code-contrast branch July 1, 2026 20:30
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.

3 participants