Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

CSS Tip! 🤙 You can create this magnetic :hover effect with CSS anchor positioning, :has, and zero JS 🔥 article { anchor-name: --develop; } ul:has(li:hover) { --anchor: --develop; } ul::after { inset: anchor(var(--anchor) top) anchor(var(--anchor) right) ... ; } How do you keep it clean when entering/exiting the list?...

729,091 Aufrufe • vor 2 Jahren •via X (Twitter)

10 Kommentare

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

Here's that @CodePen link! 🚀 Should get something good in all browsers 🫶 That's the joy of progressive enhancement!

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

Fun fact: Transitioning CSS anchor positioning wasn't going to work 🥲 But, some early demos I put together for you helped change that 🙏 The transitioning regressed in a Chome Canary update and those "fun" demos helped solve it 🔥

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

When CSS anchor-default shipped in Canary, another fun demo idea prompted whether we could use that to transition anchors 🤔 And that raised another Chromium issue 👇 The gist of the story is: "Building all sorts of different things helps the platform"

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

And this was the demo that prompted that whole CSS exploration in the first place 😅 Jus' wanted to make a bear paw move between the inputs because you can ʕノ•ᴥ•ʔノ ︵ ┻━┻

Profilbild von Guillermo Rauch
Guillermo Rauchvor 2 Jahren

🔥

Profilbild von interplato
interplatovor 2 Jahren

Any ideas how to accomplish this

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

How do you want it to work? On scroll? On click? Can definitely throw something together for you 🤙

Profilbild von Salman K A A
Salman K A Avor 2 Jahren

Made something like that using svelte.

Profilbild von Steve C
Steve Cvor 2 Jahren

Have you seen the one @KevinJPowell did where you can see the gutters on the grid? Pretty sick

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

@KevinJPowell Not sure I have. Someone tagged me in the quoted post and it reminded me of transitioning anchor position And that reminded me of an issue I raised from working with the spec last year 🤓

Ähnliche Videos