Skip to content

fix(website): make Card hover lift render border/shadow (+ accent ring)#579

Merged
blove merged 3 commits into
mainfrom
claude/card-hover-fix
Jun 5, 2026
Merged

fix(website): make Card hover lift render border/shadow (+ accent ring)#579
blove merged 3 commits into
mainfrom
claude/card-hover-fix

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented Jun 5, 2026

Summary

Card's resting border/box-shadow were set as inline styles, which beat any stylesheet :hover rule — so every hoverable card (solutions, dev/primitives, docs prev/next, and the docs fork cards) only got the translateY lift, never the shadow/border change. The docs cards papered over this with ad-hoc data-ui="docs-card" scoped <style> blocks that hit the same inline-specificity wall.

Root-cause fix (no !important):

  • Move Card's resting background/border/box-shadow/transition out of inline and into the [data-ui="card"] stylesheet. With nothing inline, the :hover rules win on specificity alone — no !important anywhere, and future states (focus, active) work for free.
  • Drive surface via data-surface and the accent fill via [data-ui="card"][data-accent].
  • Add an accent prop to Card: accent cards render the accent-tinted surface + border and gain an accent ring (0 0 0 3px accent-glow) + shadow on hover; plain cards get the neutral border-strong + shadow-md lift.
  • Replace the broken data-ui="docs-card" scoped <style> blocks on the docs landing and DocsPrevNext with the shared hoverable/accent mechanism, and delete the duplicated styles.

Follow-up to the docs polish work (#568/#573).

Test Plan

  • e2e/docs.spec.ts — 8/8
  • eslint on changed files — clean
  • Real Playwright hover(): accent cards show the ring (rgba(0,64,144,0.2) 0 0 0 3px + shadow-md, accent border preserved, translateY(-1px)); plain cards get border-strong + shadow-md; resting states unchanged
  • SSR: card elements carry data-accent/data-hoverable/data-surface with inline style trimmed to border-radius/padding only (no border/shadow/bg) — nothing blocks hover
  • CI green

🤖 Generated with Claude Code

The global [data-hoverable]:hover rule set box-shadow/border-color without
!important, so Card's inline border/box-shadow always won — only the
translate applied. Add !important so the lift renders; add an accent
variant (accent ring, keeps the accent border) via a new Card `accent`
prop. Switch the docs landing + prev/next cards from the broken ad-hoc
`data-ui="docs-card"` scoped styles to the shared hoverable/accent
mechanism and delete the duplicated <style> blocks.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 5, 2026

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

Project Deployment Actions Updated (UTC)
threadplane Ready Ready Preview, Comment Jun 5, 2026 9:08pm

Request Review

The previous fix beat Card's inline border/box-shadow with !important on the
hover rules. That treats the symptom: the resting border/box-shadow are still
inline, so every future state (focus, active) hits the same wall, and per-card
overrides have to fight !important.

Move Card's resting background/border/box-shadow/transition out of inline and
into the `[data-ui="card"]` stylesheet; drive surface via `data-surface` and the
accent fill via `[data-ui="card"][data-accent]`. With nothing inline, the hover
rules win on specificity alone — no !important anywhere. Accent cards keep the
accent ring + shadow; plain cards get the neutral border-strong + shadow lift.

Verified: e2e/docs.spec.ts 8/8; real Playwright hover shows the accent ring
(0 0 0 3px accent-glow + shadow-md) and the neutral lift render correctly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@blove blove enabled auto-merge (squash) June 5, 2026 21:07
@blove blove merged commit 048d186 into main Jun 5, 2026
19 checks passed
@blove blove deleted the claude/card-hover-fix branch June 5, 2026 21:13
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