feat(Card): hover state for clickable cards#151
Merged
corbanbrook merged 2 commits intov4from May 6, 2026
Merged
Conversation
Replace the opacity-80 hover with an outline-based hover affordance: - 2px outline in border-hover, offset 0 - border becomes transparent on hover so it doesn't read as a layered shadow under the outline Used outline (not a thicker border) to avoid the 1px layout shift that border-1 → border-2 would cause on every hover/leave. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Switches the clickable hover affordance from `outline` to `ring` (box-shadow) so it doesn't share the `outline` property with the focus-visible ring. Hover and focus can now both render without either overriding the other's offset/color. Per Corban's review on #151. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
corbanbrook
approved these changes
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hover:opacity-80affordance onclickablecards with a 2px outline inborder-hovertransparentso the outline reads as a single edge (not a layered shadow under the border)ClickableHoverstory covering all three variantsWhy outline instead of a thicker border?
A
border-1→border-2swap on hover causes a 1px layout shift on every hover/leave because the border participates in the box model.outlinelives outside the box model, so swappingoutline-2on/off doesn't reflow content.outline-offset-0keeps it tight to the edge so it reads as a border thickening, and modern browsers followborder-radiuson outlines automatically.border-transparenton hover hides the 1px card border underneath the new outline — without it, the 1px border + 2px outline stack visually like a faint shadow.Trade-off
When a card is both
:hoverand:focus-visible,hover:outline-offset-0overridesfocusRingVariants'outline-offset-2, so the focus ring snaps tight on hover. Acceptable for now; if it ever bothers us we can swap the hover affordance toring(box-shadow) so the two states use different properties.Screen.Recording.2026-05-06.at.13.05.05.mov