From 7fa6e2208be2347c5d37bfe09693afb4ba18366f Mon Sep 17 00:00:00 2001 From: Joana Moreira <31695437+JoanaMMoreira@users.noreply.github.com> Date: Thu, 4 Jul 2024 09:47:27 +0100 Subject: [PATCH] Fix Tooltip height (#3433) Co-authored-by: origami-z <5257855+origami-z@users.noreply.github.com> Co-authored-by: Josh Wooding <12938082+joshwooding@users.noreply.github.com> --- .changeset/unlucky-cats-add.md | 5 +++++ packages/core/src/tooltip/Tooltip.css | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changeset/unlucky-cats-add.md diff --git a/.changeset/unlucky-cats-add.md b/.changeset/unlucky-cats-add.md new file mode 100644 index 00000000000..71702169e14 --- /dev/null +++ b/.changeset/unlucky-cats-add.md @@ -0,0 +1,5 @@ +--- +"@salt-ds/core": patch +--- + +Fixed `Tooltip` not having correct height. diff --git a/packages/core/src/tooltip/Tooltip.css b/packages/core/src/tooltip/Tooltip.css index b512a078fd4..c4f276ad94c 100644 --- a/packages/core/src/tooltip/Tooltip.css +++ b/packages/core/src/tooltip/Tooltip.css @@ -5,9 +5,12 @@ /* apply icon margin based on the text line height so it's aligned on all densities */ --tooltip-icon-marginTop: calc((var(--salt-text-lineHeight) - max(var(--salt-icon-size-base), 12px)) / 2); --tooltip-status-borderColor: var(--salt-container-primary-borderColor); + /* Single line height should be size-base */ + --tooltip-padding: calc(var(--salt-spacing-75) - var(--salt-size-border)) var(--salt-spacing-100); } .saltTooltip { + box-sizing: border-box; background: var(--tooltip-background); border-color: var(--saltTooltip-borderColor, var(--tooltip-status-borderColor)); border-style: var(--saltTooltip-borderStyle, var(--salt-container-borderStyle)); @@ -20,7 +23,7 @@ font-weight: var(--saltTooltip-fontWeight, var(--salt-text-fontWeight)); line-height: var(--saltTooltip-lineHeight, var(--salt-text-lineHeight)); max-width: var(--saltTooltip-maxWidth, 230px); - padding: var(--saltTooltip-padding, var(--salt-spacing-100)); + padding: var(--saltTooltip-padding, var(--tooltip-padding)); position: relative; text-align: var(--saltTooltip-textAlign, left); z-index: var(--tooltip-zIndex);