From f50e1020ff499621f8205e5e5ffb72281dab5642 Mon Sep 17 00:00:00 2001 From: Felix Mosheev <9304194+felixmosh@users.noreply.github.com> Date: Sun, 15 Sep 2024 16:22:45 +0300 Subject: [PATCH] fix: prevent linebreak on tooltip --- .../src/components/Tooltip/Tooltip.module.css | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/packages/ui/src/components/Tooltip/Tooltip.module.css b/packages/ui/src/components/Tooltip/Tooltip.module.css index ba6e6a4c..c51e88f2 100644 --- a/packages/ui/src/components/Tooltip/Tooltip.module.css +++ b/packages/ui/src/components/Tooltip/Tooltip.module.css @@ -1,27 +1,28 @@ .tooltip { - position: relative; + position: relative; } .tooltip:before { - content: attr(data-title); - padding: 0.2em 0.75em; - background-color: rgba(45, 55, 72, 0.95); - color: #fff; - border-radius: 0.28571429rem; - font-size: 0.833rem; - font-weight: 300; - position: absolute; - bottom: 100%; - margin-bottom: 0.75rem; - left: 50%; - transform: translateX(-50%) translateY(-25%); - transition: transform 250ms ease-in-out, opacity 250ms ease-in-out; - pointer-events: none; - opacity: 0; - z-index: 2; + content: attr(data-title); + padding: 0.2em 0.75em; + background-color: rgba(45, 55, 72, 0.95); + color: #fff; + border-radius: 0.28571429rem; + font-size: 0.833rem; + font-weight: 300; + position: absolute; + bottom: 100%; + margin-bottom: 0.75rem; + left: 50%; + transform: translateX(-50%) translateY(-25%); + transition: transform 250ms ease-in-out, opacity 250ms ease-in-out; + pointer-events: none; + opacity: 0; + z-index: 2; + white-space: nowrap; } .tooltip:hover:before { - transform: translateX(-50%) translateY(0); - opacity: 1; + transform: translateX(-50%) translateY(0); + opacity: 1; }