diff --git a/src/styles/gantry.css b/src/styles/gantry.css index 4da53a6..be218d1 100644 --- a/src/styles/gantry.css +++ b/src/styles/gantry.css @@ -579,13 +579,21 @@ html .drive-control-button svg { inline-size: 18px; block-size: 18px; } } /* Tooltips and the settings popover open downward from the beam. */ +/* Tooltips hang from the button's right edge so the last one never leaves + the viewport; the label is decorative (the button has its aria-label). */ html .drive-control-button::after { - inset: calc(100% + 0.5rem) auto auto 50%; - transform: translate(-50%, -4px); + content: attr(data-tooltip) / ''; + inset: calc(100% + 0.5rem) 0 auto auto; + transform: translateY(-4px); } html .drive-control-button:hover::after, html .drive-control-button:focus-visible::after { - transform: translate(-50%, 0); + transform: none; +} +/* An open popover is its own label; touch screens get no hover labels. */ +html .drive-control-button[aria-expanded='true']::after { display: none; } +@media (hover: none) { + html .drive-control-button::after { display: none; } } html .drive-popover { position: absolute;