Video wird geladen...
Video konnte nicht geladen werden
sliding hover tip effect with CSS :has() and anchor positioning ✨ :root:has(li:nth-of-type(3):hover) { --i: 3; } .track { translate: 0 calc(var(--i) * -1lh); nav { anchor-name: --nav; } .tip { position-anchor: --nav; left: calc(anchor(right) + 1rem); }
164,722 Aufrufe • vor 2 Jahren •via X (Twitter)
10 Kommentare

jhey ▲🐻🎈vor 2 Jahren
here's the @CodePen for this one 🚀 updated it so you can explicitly define the flow of how the text slides 🤙

Arsyadvor 2 Jahren
silky tooltip @silkysignon

ANOOPvor 2 Jahren
Looks cool For the the Horizontal menu the text moving sideways would have looked super cool

Erik Rasmussen 👨💻🇺🇸🇪🇸vor 2 Jahren
I assume this is okay for a11y, because "tooltips as divs" are ignored by screen readers, and the information is portrayed through other means?

jhey ▲🐻🎈vor 2 Jahren
Yeah, for that reason [aria-hidden] on the tip itself and readable navigation links with a class to visually hide them but not from screen readers 🤙

Dheeraj Purohit धीरज पुरोहित ⭕❗⭕vor 2 Jahren
@Sikandar_Bhide

Robin Stoytchevvor 2 Jahren
Codepen posted? Really nice 🙌

Private WIFIvor 2 Jahren
Wen book release

Brianvor 2 Jahren
Instead of Pinball Wizard, you're a CSS Wizard

Ayan Patelvor 2 Jahren
👏
