Loading video...

Video Failed to Load

Go Home

CSS sidebar tricks 🤌 transition expanded menu items to "auto" height using grid li > div[inert] { grid-template-rows: 0fr; } li > div { grid-template-rows: 1fr; transition: grid-template-rows .3s; }

117,372 views • 1 year ago •via X (Twitter)

10 Comments

Pavel Ivanov's profile picture
Pavel Ivanov1 year ago

yeah :) I use something close to this in react-scan! The old min/max-height hacks are no more!

jhey ▲🐻🎈's profile picture
jhey ▲🐻🎈1 year ago

yeah - solid solution until we get decent support for interpolate-size 🙏

MGSimard's profile picture
MGSimard1 year ago

Oh man inert is a thing? yoink

jhey ▲🐻🎈's profile picture
jhey ▲🐻🎈1 year ago

yep!🤙 so good for things where you need to hide from AT etc. but don't really want to use display none

Arthur's profile picture
Arthur1 year ago

Bro is working on Vercel itself...

jhey ▲🐻🎈's profile picture
jhey ▲🐻🎈1 year ago

🫡

Diogo's profile picture
Diogo1 year ago

Didn't know about this inert attribute. Cool.

jhey ▲🐻🎈's profile picture
jhey ▲🐻🎈1 year ago

super useful 💯 being able to hide things without juggling display none makes transitions so much easier 🙌

Roo and Sashas Happy Days's profile picture
Roo and Sashas Happy Days1 year ago

how does inert effect accessibility when using keyboard with these buttons

Typzo's profile picture
Typzo1 year ago

Probably one of the best tricks grid has to offer!

Related Videos