正在加载视频...

视频加载失败

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 次观看 • 2 年前 •via X (Twitter)

9 条评论

jhey ▲🐻🎈 的头像
jhey ▲🐻🎈2 年前

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 🤙

Arunabh Verma 的头像
Arunabh Verma2 年前

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?

𝓈𝓃𝑜𝓌𝓎 𝚙𝚑𝚒𝚕 🌌✨❄️🫂 的头像
𝓈𝓃𝑜𝓌𝓎 𝚙𝚑𝚒𝚕 🌌✨❄️🫂2 年前

@chrrynobaka

Daniel Vaughn 的头像
Daniel Vaughn2 年前

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.

wsk 的头像
wsk2 年前

Can this be animated? Like here:

Agrim Sharma 的头像
Agrim Sharma2 年前

So cool

Nine 的头像
Nine2 年前

My G haha

Nir Galon 的头像
Nir Galon2 年前

Cool 😎

Alex Inkin 的头像
Alex Inkin2 年前

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

相关视频