Skip to content

Commit

Permalink
Fix Tooltip status icon alignment (#2687)
Browse files Browse the repository at this point in the history
  • Loading branch information
origami-z authored Nov 10, 2023
1 parent abeeac9 commit 1ae74f4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/ten-humans-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@salt-ds/core": patch
---

Fix Tooltip status icon alignment
2 changes: 1 addition & 1 deletion packages/core/src/tooltip/Tooltip.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
--tooltip-background: var(--saltTooltip-background, var(--salt-container-primary-background));
--tooltip-zIndex: var(--saltTooltip-zIndex, var(--salt-zIndex-flyover));
/* apply icon margin based on the text line height so it's aligned on all densities */
--tooltip-icon-marginTop: calc((var(--salt-text-lineHeight) - 12px) / 2);
--tooltip-icon-marginTop: calc((var(--salt-text-lineHeight) - max(var(--salt-icon-size-base), 12px)) / 2);
}

.saltTooltip {
Expand Down
10 changes: 9 additions & 1 deletion packages/core/stories/tooltip/tooltip.qa.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@ export const AllExamplesGrid: StoryFn<QAContainerProps> = (props) => {
<IconWithTooltip content="Hello, World" />
<IconWithTooltip status="error" content="Uh oh, world" />
<IconWithTooltip
content={<div style={{ background: "#ccc", width: 60, height: 20 }} />}
content={
<div
style={{
background: "var(--salt-text-secondary-foreground)",
width: 60,
height: "var(--salt-text-lineHeight)",
}}
/>
}
/>
<div
style={{
Expand Down

1 comment on commit 1ae74f4

@vercel
Copy link

@vercel vercel bot commented on 1ae74f4 Nov 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.