From edbcc13db42cd99322bc3d0f135ba4a6c74d0524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Gla=CC=88ser?= Date: Tue, 26 May 2026 09:12:54 +0200 Subject: [PATCH] Replace hardcoded tooltip inset with foundation-token-derived value --- .../vsf-card-listen-fundamentalanalyse-drawer.html | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/patterns/vsf-card-listen-fundamentalanalyse-drawer.html b/patterns/vsf-card-listen-fundamentalanalyse-drawer.html index 3951f10..18d0793 100644 --- a/patterns/vsf-card-listen-fundamentalanalyse-drawer.html +++ b/patterns/vsf-card-listen-fundamentalanalyse-drawer.html @@ -474,7 +474,17 @@ } const clampedRect = panel.getBoundingClientRect(); - const safeInset = 8; + const rootStyles = getComputedStyle(document.documentElement); + const spacingSmallRaw = rootStyles.getPropertyValue('--spacing-small').trim(); + const rootFontSize = parseFloat(rootStyles.fontSize) || 16; + const spacingSmallValue = parseFloat(spacingSmallRaw); + const safeInset = Number.isNaN(spacingSmallValue) + ? 0 + : ( + spacingSmallRaw.endsWith('rem') + ? spacingSmallValue * rootFontSize + : spacingSmallValue + ); let shiftX = 0; if (clampedRect.right > (viewportWidth - safeInset)) {