-
Notifications
You must be signed in to change notification settings - Fork 5
Added Metadata Tooltip Information Modals #707
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import { style } from "@vanilla-extract/css" | ||
| import { colors } from "src/style/constants" | ||
|
|
||
| export const container = style({ | ||
| position: "relative", | ||
| display: "inline-flex", | ||
| alignItems: "center", | ||
| marginLeft: "6px", | ||
| verticalAlign: "middle", | ||
| }) | ||
|
|
||
| export const icon = style({ | ||
| color: colors.primary, | ||
| fontSize: "14px", | ||
| transition: "color 0.2s ease", | ||
| cursor: "pointer", | ||
| selectors: { | ||
| [`${container}:hover &`]: { | ||
| color: "#333", | ||
| }, | ||
| }, | ||
| }) | ||
|
|
||
| export const tooltip = style({ | ||
| position: "absolute", | ||
| bottom: "120%", | ||
| left: "50%", | ||
| transform: "translateX(-50%)", | ||
| width: "240px", | ||
| padding: "10px 14px", | ||
| backgroundColor: "white", | ||
| color: "black", | ||
| borderRadius: "6px", | ||
| fontSize: "12px", | ||
| lineHeight: "1.5", | ||
| zIndex: 1000, | ||
| boxShadow: "0 4px 12px rgba(0,0,0,0.15)", | ||
| visibility: "hidden", | ||
| opacity: 0, | ||
| pointerEvents: "none", | ||
| textAlign: "left", | ||
|
|
||
| // CSS of the little triangle arrow at the bottom | ||
| ":after": { | ||
| content: '""', | ||
| position: "absolute", | ||
| top: "100%", | ||
| left: "50%", | ||
| marginLeft: "-5px", | ||
| borderWidth: "5px", | ||
| borderStyle: "solid", | ||
| borderColor: "white transparent transparent transparent", | ||
| }, | ||
|
|
||
| selectors: { | ||
| [`${container}:hover &`]: { | ||
| visibility: "visible", | ||
| opacity: 1, | ||
| }, | ||
| }, | ||
| }) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would suggest not making a new tsx file for just info tooltips since it will probably be used for metadata only. It might be better to condense files by making |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import React from "react" | ||
| import { FiInfo } from "react-icons/fi/index" | ||
| import * as css from "./info-tooltip.css" | ||
|
|
||
| interface InfoTooltipProps { | ||
| content: string | ||
| } | ||
|
|
||
| export const InfoTooltip: React.FC<InfoTooltipProps> = ({ content }) => { | ||
| return ( | ||
| <div className={css.container}> | ||
| <FiInfo className={css.icon} /> | ||
| <div className={css.tooltip}>{content}</div> | ||
| </div> | ||
| ) | ||
| } |
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would suggest not making a new tsx file for just info tag selectors since it will probably be used for metadata only. It might be better to condense files by making |
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.
looks great! Only thing I'd suggest is to avoid pixels/px units & using rem instead if possible according to the code standards, but no changes needed here since the tooltips still look nice in smaller screens.