正在加载视频...

视频加载失败

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

33 条评论

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 年前

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 的头像
Yannis1 年前

Wen jh3yycn-ui component library?

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 年前

working on it 😅

Yannis 的头像
Yannis1 年前

🔥🔥🔥

Jeppe 的头像
Jeppe1 年前

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 ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 年前

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 的头像
Soren1 年前

THIS IS SO GOATED!!

Chuks Gabriel 的头像
Chuks Gabriel1 年前

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

Cog_ 的头像
Cog_1 年前

You win 🏆

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 年前

🙌🙌🙌

Dero 的头像
Dero1 年前

Where's the code? Asking for a friend

Mike Deufel 的头像
Mike Deufel1 年前

This is insane

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 年前

🫶

Noctaupüs! - Graphiste freelance lille 的头像
Noctaupüs! - Graphiste freelance lille1 年前

Very impressive !

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 年前

🙏🙏

Tom 的头像
Tom1 年前

You’re a CSS god

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 年前

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

Kumar Deepanshu 的头像
Kumar Deepanshu1 年前

Cool.

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 年前

🙏

Neel Shah 的头像
Neel Shah1 年前

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

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 年前

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

Rebane 的头像
Rebane1 年前

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

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 年前

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 的头像
Rebane1 年前

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 ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 年前

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 的头像
Minh Luan1 年前

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

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 年前

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 的头像
Danny Clayden Chambers1 年前

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 的头像
develops1 年前

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 ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 年前

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

Sijan 的头像
Sijan1 年前

🔥

Pochi 的头像
Pochi1 年前

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 的头像
sears1 年前

Is it pure CSS3? 🤔

相关视频