From 646361e8bfd1535f223b754385010908badc24f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8jberg?= Date: Thu, 25 Jul 2024 15:14:08 -0400 Subject: [PATCH] Improve tooltip sizing --- src/Code/Syntax/SyntaxSegment.elm | 2 +- src/css/code/syntax.css | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Code/Syntax/SyntaxSegment.elm b/src/Code/Syntax/SyntaxSegment.elm index d987ef00..af07718f 100644 --- a/src/Code/Syntax/SyntaxSegment.elm +++ b/src/Code/Syntax/SyntaxSegment.elm @@ -306,7 +306,7 @@ view linked ((SyntaxSegment sType sText) as segment) = in Tooltip.view (span - [ class className ] + [ class "syntax-help", class className ] [ content ] ) tooltip diff --git a/src/css/code/syntax.css b/src/css/code/syntax.css index 1d7f7a1f..c8359a48 100644 --- a/src/css/code/syntax.css +++ b/src/css/code/syntax.css @@ -37,6 +37,16 @@ code a:active .tooltip-trigger.tooltip_show .tooltip { display: none; } +.tooltip-trigger:has(.syntax-help) .tooltip { + margin-left: -0.5rem; +} + +.tooltip-trigger:has(.syntax-help) .tooltip-bubble { + max-width: 22rem; + min-width: 22rem; + white-space: pre-wrap; +} + .rich .fqn .sep { color: var(--color-syntax-subtle); }