正在加载视频...

视频加载失败

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

10 条评论

Pavel Ivanov 的头像
Pavel Ivanov1 年前

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

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

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

MGSimard 的头像
MGSimard1 年前

Oh man inert is a thing? yoink

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

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

Arthur 的头像
Arthur1 年前

Bro is working on Vercel itself...

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

🫡

Diogo 的头像
Diogo1 年前

Didn't know about this inert attribute. Cool.

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

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

Roo and Sashas Happy Days 的头像
Roo and Sashas Happy Days1 年前

how does inert effect accessibility when using keyboard with these buttons

Typzo 的头像
Typzo1 年前

Probably one of the best tricks grid has to offer!

相关视频