Skip to content

fix(contributor-card): align card with native hovercard in dark mode#37

Merged
rrbe merged 2 commits into
mainfrom
fix/contributor-card-dark-border
Jun 24, 2026
Merged

fix(contributor-card): align card with native hovercard in dark mode#37
rrbe merged 2 commits into
mainfrom
fix/contributor-card-dark-border

Conversation

@rrbe

@rrbe rrbe commented Jun 23, 2026

Copy link
Copy Markdown
Owner

In dark mode, the contributor card didn't read as a seamless continuation of GitHub's native hovercard bubble. Three issues, all invisible (or nearly) in light mode — which is why they went unnoticed.

1. Doubled border

The card had a 1px border and box-shadow: var(--shadow-floating-small). In dark mode that token's first layer is an opaque 0 0 0 1px #3d444d ring in the exact border color — stacked on the border, the card's edges rendered as a ~2px band, while the bubble stayed 1px (GitHub forces .Popover-message's box-shadow to none, so our override there never applied). In light mode the ring is a translucent halo, hence invisible.

Fix: drop the card's box-shadow — the 1px border is now the single edge, identical to the bubble's. Also removed the now-dead box-shadow from the .Popover-message override.

2. Surface (background) mismatch

The card used --bgColor-default (#0d1117, the page canvas) instead of the popover overlay surface --overlay-bgColor (#010409) the bubble uses, so it sat a shade lighter than the bubble.

Fix: card background --bgColor-default--overlay-bgColor. Both are #fff in light mode, so no change there.

3. Stray caret in the seam

When GitHub opens the hovercard above the trigger, the bubble's caret sits on its bottom edge (.Popover-message--bottom*). With our card attached below, that down-pointing caret lands in the seam between bubble and card — a chevron pointing into nothing. Its fill is a fixed light color, so in dark mode it's a bright notch. (Appears "on first hover" → really whenever GitHub places the card above the trigger, which depends on viewport space.)

Fix: hide the bottom-edge caret when our card is present. The top-edge caret (card opens below the trigger) is left intact — it correctly points up at the trigger, clear of our card.

Verification

Reproduced and confirmed live in Chrome (dark & light):

  • After the fixes, card background, 1px border color, and (absent) shadow all equal the bubble's; the seam caret is gone.
  • Geometry (left/right edges) and content column (x=387) were already pixel-aligned with the bubble.
  • pnpm build passes.

rrbe added 2 commits June 24, 2026 00:16
The contributor card read as a separate, lighter, thicker-bordered box
from GitHub's native hovercard bubble in dark mode (both invisible in
light mode):

- Doubled border: the card had a 1px border AND box-shadow:
  var(--shadow-floating-small), whose first layer is an opaque
  '0 0 0 1px #3d444d' ring in the exact border color. Stacked on the
  border, the card's edges rendered as a ~2px band, while the bubble
  stayed 1px (GitHub forces the bubble's box-shadow to none). Dropped
  the box-shadow so the 1px border is the single edge, matching the
  bubble. In light mode that ring is a translucent halo, hence invisible.

- Surface mismatch: the card used --bgColor-default (#0d1117, page
  canvas) while the bubble is an overlay surface (--overlay-bgColor,
  #010409). Switched the card to --overlay-bgColor so the two share one
  surface color. Both are #fff in light mode, so no visible change there.

Also removed the now-dead box-shadow from the .Popover-message override
(it never applied — GitHub forces it to none).

Verified live in dark mode: card bg, 1px border color, and (absent)
shadow now equal the bubble's; content column and geometry already
aligned to the pixel.
When GitHub opens the hovercard above the trigger, the bubble's caret
sits on its bottom edge (.Popover-message--bottom*). With our card
attached below the bubble, that down-pointing caret lands in the seam
between the bubble and the card — a stray chevron pointing into the
card. Its fill is a fixed light color, so in dark mode it reads as a
bright notch (the user noticed it appearing 'on first hover' — really
whenever GitHub places the card above the trigger).

Our card is the popover's real bottom now, so the bubble's bottom
pointer is meaningless. Hide the bottom-edge caret when our card is
present. The top-edge caret (card opens below the trigger) is left
intact — it points up at the trigger, clear of our card.

Verified live: caret gone from the seam; specificity wins without
!important.
@rrbe rrbe changed the title fix(contributor-card): match native bubble border/bg in dark mode fix(contributor-card): align card with native hovercard in dark mode Jun 23, 2026
@rrbe rrbe merged commit 81f152a into main Jun 24, 2026
1 check passed
@rrbe rrbe deleted the fix/contributor-card-dark-border branch June 24, 2026 01: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.

1 participant