Loading video...

Video Failed to Load

Go Home

responsive CSS pinned sidebar transition 📌 .layout:has(:popover-open) { grid-template-columns: var(--sidebar-width) 1fr; } aside:popover-open { translate: 0 var(--ctrl); height: var(--extend); } actual zero JS for the layout transition here so many details to play with! 🧑‍🍳

387,743 views • 1 year ago •via X (Twitter)

33 Comments

jhey ʕ•ᴥ•ʔ's profile picture
jhey ʕ•ᴥ•ʔ1 year ago

noticed a fair few "details" missing in the original – made sure to put them in my version, will follow up with some posts for them 🤙 here's the @CodePen 🚀

Yannis's profile picture
Yannis1 year ago

Wen jh3yycn-ui component library?

jhey ʕ•ᴥ•ʔ's profile picture
jhey ʕ•ᴥ•ʔ1 year ago

working on it 😅

Yannis's profile picture
Yannis1 year ago

🔥🔥🔥

Jeppe's profile picture
Jeppe1 year ago

I’ve seen this layout/pattern quite a times here this past week. How can anyone be okay with the fact that this will squeeze the main content view? If there are cards like flex content in the main container, it’ll get wrapped downwards and text width will get reduced so the letters jump to new lines.. The user will get cognitive overload for content moving around unnecessarily? What am I not getting here? Besides that - cool demo!

jhey ʕ•ᴥ•ʔ's profile picture
jhey ʕ•ᴥ•ʔ1 year ago

Not at all, I completely agree 💯 I was jus tagged a bunch to make it 😅 It’s for more of a canvas type UI in my opinion or one where the content is constrained to a certain width but would still have that shift at certain sizes 😫

Soren's profile picture
Soren1 year ago

THIS IS SO GOATED!!

Chuks Gabriel's profile picture
Chuks Gabriel1 year ago

The master himself has done it. Can you share the source please?

Cog_'s profile picture
Cog_1 year ago

You win 🏆

jhey ʕ•ᴥ•ʔ's profile picture
jhey ʕ•ᴥ•ʔ1 year ago

🙌🙌🙌

Dero's profile picture
Dero1 year ago

Where's the code? Asking for a friend

Mike Deufel's profile picture
Mike Deufel1 year ago

This is insane

jhey ʕ•ᴥ•ʔ's profile picture
jhey ʕ•ᴥ•ʔ1 year ago

🫶

Noctaupüs! - Graphiste freelance lille's profile picture
Noctaupüs! - Graphiste freelance lille1 year ago

Very impressive !

jhey ʕ•ᴥ•ʔ's profile picture
jhey ʕ•ᴥ•ʔ1 year ago

🙏🙏

Tom's profile picture
Tom1 year ago

You’re a CSS god

jhey ʕ•ᴥ•ʔ's profile picture
jhey ʕ•ᴥ•ʔ1 year ago

strive to break down these things for people best I can 🙏

Kumar Deepanshu's profile picture
Kumar Deepanshu1 year ago

Cool.

jhey ʕ•ᴥ•ʔ's profile picture
jhey ʕ•ᴥ•ʔ1 year ago

🙏

Neel Shah's profile picture
Neel Shah1 year ago

it’s crazy how you come through everytime with something better than the original

jhey ʕ•ᴥ•ʔ's profile picture
jhey ʕ•ᴥ•ʔ1 year ago

🙏🧑‍🍳 that’s what I’m here for

Rebane's profile picture
Rebane1 year ago

add visibility:hidden (possibly with a one-way discrete transition) for accessibility

jhey ʕ•ᴥ•ʔ's profile picture
jhey ʕ•ᴥ•ʔ1 year ago

torn on this one - or if it’s even a pattern that could be done well accessibly jus’ had a bunch of tags requesting to make it borders between a couple of WAI-ARIA patterns but design feels like it should always be available. the control does nothing but pin visually

Rebane's profile picture
Rebane1 year ago

that's fair if you think it should be tab-accessible even when collapsed (in that case i'd also make it visible for :focus-within)

jhey ʕ•ᴥ•ʔ's profile picture
jhey ʕ•ᴥ•ʔ1 year ago

yep - that’s how it works. hard to show all the details in the one clip. but the / key shows it by focussing the filter input and sliding open at the same time 🤔 still not 100% about it but there are some absolutely horrendous sidebar implementations out there 😅

Minh Luan's profile picture
Minh Luan1 year ago

It's nice 🫶🫶, but how does it look on mobile?

jhey ʕ•ᴥ•ʔ's profile picture
jhey ʕ•ᴥ•ʔ1 year ago

on mobile it turns into the typical sidebar drawer with a different button 🤙 means we don’t need to duplicate the markup or anything wild

Danny Clayden Chambers's profile picture
Danny Clayden Chambers1 year ago

In every version I’ve seen so far, the button shifts when clicked, which seems flawed to me - I feel like top level controls should not move.

develops's profile picture
develops1 year ago

How would you do the same but overlay the menu over the content? We want the sidebar to open on hover and keep open when we pin it (via an icon) And vice versa

jhey ʕ•ᴥ•ʔ's profile picture
jhey ʕ•ᴥ•ʔ1 year ago

Is that not what’s happening here? we slide it over on hover/focus then pin it on click

Sijan's profile picture
Sijan1 year ago

🔥

Pochi's profile picture
Pochi1 year ago

This is a brilliant use of :has() and popover! Love the creativity in achieving this with zero JS. The smooth transition is just chef's kiss🧑‍🍳. Thanks for sharing!

sears's profile picture
sears1 year ago

Is it pure CSS3? 🤔

Related Videos