Skip to content

feat(ui): make code blocks distinct from comment background#2879

Merged
charlesvien merged 1 commit into
mainfrom
posthog-code/distinct-codeblock-styling
Jun 24, 2026
Merged

feat(ui): make code blocks distinct from comment background#2879
charlesvien merged 1 commit into
mainfrom
posthog-code/distinct-codeblock-styling

Conversation

@MattPua

@MattPua MattPua commented Jun 23, 2026

Copy link
Copy Markdown
Member

Problem

Code blocks rendered inside comment/finding bodies blended into the cards wrapping them. The shared CodeBlock primitive used a gray-2 fill — the same color as the PR comment card around it — with a faint gray-4 border, so fenced code blocks were nearly indistinguishable from the surrounding comment.

Changes

Before:
CleanShot 2026-06-23 at 16 20 21@2x

After:
CleanShot 2026-06-23 at 16 20 10@2x

  • Bumped the <pre> fill from gray-2 to gray-3 and the border from gray-4 to gray-6, so code blocks read as a distinct, slightly recessed panel.
  • Single-file change to the shared CodeBlock primitive — PR comment threads, scout emission cards, and signal cards all benefit at once.
  • gray-3/gray-6 are mode-aware Radix steps, so light and dark mode both stay correct.

How did you test this?

  • Ran pnpm --filter @posthog/ui typecheck — passes.
  • Did not visually verify in the running app.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

Code blocks shared the gray-2 fill of the comment cards wrapping them,
so they blended in. Bump the pre fill to gray-3 and border to gray-6.

Generated-By: PostHog Code
Task-Id: 0c9f803f-d5c2-4da1-b0d6-1cc318d563b2
@github-actions

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 5157e02.

@greptile-apps

greptile-apps Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "fix(ui): make code blocks distinct from ..." | Re-trigger Greptile

@MattPua MattPua requested a review from a team June 23, 2026 20:20
@MattPua MattPua changed the title fix(ui): make code blocks distinct from comment background feat(ui): make code blocks distinct from comment background Jun 23, 2026
@MattPua MattPua requested a review from adamleithp June 23, 2026 20:36
@charlesvien charlesvien merged commit 1d23e24 into main Jun 24, 2026
20 checks passed
@charlesvien charlesvien deleted the posthog-code/distinct-codeblock-styling branch June 24, 2026 03:22
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.

2 participants