-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify hover detection #890
Conversation
Tagged @jameshadfield as author of these lines and @genehack in case you're interested in front-end work related to #870 |
static-site/src/components/ListResources/IndividualResource.jsx
Outdated
Show resolved
Hide resolved
2777903
to
b051baf
Compare
- Use CSS hover selector instead of relying on a prop - Limit the scope of ResourceLinkWrapper to just adding shift-click behavior
b051baf
to
4b6cee4
Compare
|
||
&:not(:hover)::before { | ||
content: "${(props) => props.$content}"; | ||
} | ||
|
||
&:hover::before { | ||
content: "${(props) => props.$hoverContent || props.$content}"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-blocking
This isn't what I meant… but that's on me for not specifying it and assuming you'd understand. I meant to include the content in the HTML itself (rather than using pseudo-elements in CSS) and only show the last label/name until hovered.
Don't worry about doing anything different now. I wanted to point out that I think there's a simplification here that's not mixing runtime inspection of CSS states with React component rendering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh gotcha, thanks for clarifying. I'll just drop bfbf4da and merge this PR. Maybe will try out that idea later...
bfbf4da
to
4b6cee4
Compare
preview
Description of proposed changes
Related issue(s)
N/A, thought of this while working on #874
Checklist
Check if changes affect the resource index JSON revision