Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

Putting CSS Anchor Positioning to the test by throwing dropdown menus around 💪 [popover].dropdown { top: anchor(bottom); right: anchor(right); position-try-options: flip-block, flip-inline; } That's all 👆 Keeps the menu tethered to the button

112,008 Aufrufe • vor 2 Jahren •via X (Twitter)

9 Kommentare

Profilbild von jhey ▲🐻🎈
jhey ▲🐻🎈vor 2 Jahren

Here's the @CodePen link! 🚀 Starting to piece together these demos for @figma Config 2024 🫡 This demo should be good everywhere. Where Anchoring isn't supported, it uses floating-ui 🤙

Profilbild von Arunabh Verma
Arunabh Vermavor 2 Jahren

Cool, I tried something similar with React Native. I had to find the distance between the edge and the menu, then change its position. Curious about the throwing menu—how is it so smooth? Did you nail that with CSS or need some JS?

Profilbild von 𝓈𝓃𝑜𝓌𝓎 𝚙𝚑𝚒𝚕 🌌✨❄️🫂
𝓈𝓃𝑜𝓌𝓎 𝚙𝚑𝚒𝚕 🌌✨❄️🫂vor 2 Jahren

@chrrynobaka

Profilbild von Daniel Vaughn
Daniel Vaughnvor 2 Jahren

One gotcha that I’ve noticed is that source order matters. You can’t reference an anchor name before it’s declared. Makes sense, but depending the scenario, it can definitely be a pain.

Profilbild von wsk
wskvor 2 Jahren

Can this be animated? Like here:

Profilbild von Agrim Sharma
Agrim Sharmavor 2 Jahren

So cool

Profilbild von Nine
Ninevor 2 Jahren

My G haha

Profilbild von Nir Galon
Nir Galonvor 2 Jahren

Cool 😎

Profilbild von Alex Inkin
Alex Inkinvor 2 Jahren

Is it possible to shrink height up to some point before flipping vertically?

Ähnliche Videos