Skip to content

fix(components): hover anywhere on a gallery card activates it - #485

Merged
schloerke merged 1 commit into
mainfrom
schloerke/gallery-card-unified-hover
Sep 25, 2026
Merged

schloerke merged 1 commit into
mainfrom
schloerke/gallery-card-unified-hover

Conversation

@schloerke

Copy link
Copy Markdown
Contributor

Summary

On /components/, hovering a thumbnail didn't fill the arrow, and hovering the title or arrow didn't play the GIF. Now the whole column (title, arrow, and thumbnail) is one hover target: the GIF plays, the card lifts, the arrow fills, and the title darkens together.

  • components-list.css: the hover and focus styles now key off .component-list-column:is(:hover, :has(:focus-visible)) instead of separate :hover rules and the old sibling selector.
  • components-list.js: the play/stop listeners are on the column. Keyboard focus uses focusin/focusout with a relatedTarget check, so tabbing title → arrow → card within one column keeps the GIF playing instead of restarting it. The existing touch and reduced-motion guards are unchanged.

Verification

Open /components/ on the preview deploy and hover a component's title, arrow, and thumbnail in turn. Each one plays the GIF, lifts the card, and fills the arrow. Tabbing through the links does the same.

Checked locally with Playwright against a render of components/index.qmd:

  • A real mouse hover on the arrow started the GIF and lifted the card.
  • A real hover on the thumbnail filled the arrow and turned the title black, while an unhovered column stayed normal.
  • Tabbing within a column kept the preview playing.
  • The title hover was checked with simulated pointer events only.

Hovering or focusing the title, arrow, or thumbnail now plays the preview GIF, lifts the card, fills the arrow, and darkens the title together. Previously the GIF and shadow only reacted to the thumbnail and the arrow only to the title/arrow.
@schloerke
schloerke marked this pull request as ready for review September 25, 2026 18:27
@schloerke
schloerke enabled auto-merge (squash) September 25, 2026 18:27
@schloerke
schloerke merged commit f615c97 into main Sep 25, 2026
31 checks passed
@schloerke
schloerke deleted the schloerke/gallery-card-unified-hover branch September 25, 2026 18:37

This branch was successfully deployed

1 active deployment
pr-485 — 1f658363 Deployed Sep 25, 2026 by github-actions[bot]
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