From 795b10959f9e50bb28d1ea6fe2985a74fec04b55 Mon Sep 17 00:00:00 2001 From: Spythere Date: Wed, 29 Jan 2025 19:38:29 +0100 Subject: [PATCH] chore: added css tooltips --- src/style.css | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/style.css b/src/style.css index 05f05d7..3e7c5f5 100644 --- a/src/style.css +++ b/src/style.css @@ -28,6 +28,33 @@ body { border-radius: theme('borderRadius.md'); } +/* Tooltips */ +[data-tooltip] { + position: relative; +} + +[data-tooltip] > .tooltip-content { + visibility: hidden; + background-color: theme('colors.inherit'); + min-width: 125px; + color: inherit; + text-align: center; + border-radius: theme('borderRadius.md'); + padding: 0.25rem 0.5rem; + + position: absolute; + z-index: 1; + + top: calc(100% + 0.5rem); + left: 50%; + transform: translateX(-50%); +} + +[data-tooltip]:hover > .tooltip-content, +[data-tooltip]:focus-visible > .tooltip-content { + visibility: visible; +} + @media print { :root { color-scheme: light;