Skip to content

Commit

Permalink
feat: add max-width and adjust styling of tooltip image and descripti…
Browse files Browse the repository at this point in the history
…on text (#2115)
  • Loading branch information
joewoodson authored Nov 26, 2024
1 parent 8889a65 commit fd1da3c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/honest-hounds-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@frontify/fondue-charts": patch
---

adjust chart tooltip styling to accomodate very long titles used in combination with tooltip preview images
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export const TooltipContent = ({ title, description, imageUrl, entries }: Toolti
const dataPoint = entries[1];

return (
<div className="tw-bg-[var(--text-color)] tw-p-3 tw-rounded tw-border tw-border-button-border">
<div className="tw-bg-[var(--text-color)] tw-p-3 tw-rounded tw-border tw-border-button-border tw-max-w-[260px]">
{imageUrl && (
<div className="tw--m-1">
<img src={imageUrl} alt={description} className="tw-w-48 tw-h-28 tw-object-cover tw-mb-5" />
<img src={imageUrl} alt={description} className="tw-h-28 tw-object-cover tw-mb-5 tw-w-full" />
</div>
)}
<div className={title ? 'tw-pb-3' : ''}>
Expand All @@ -37,7 +37,9 @@ export const TooltipContent = ({ title, description, imageUrl, entries }: Toolti
{descriptionLines.length > 0 && (
<div className="tw-text-base tw-text-xs">
{descriptionLines.map((line) => (
<div key={line}>{line}</div>
<div key={line} className="tw-truncate">
{line}
</div>
))}
</div>
)}
Expand Down

0 comments on commit fd1da3c

Please sign in to comment.