正在加载视频...

视频加载失败

a little css trick i like ↓ adapt the radius gradually based on available space shrink from --r to 0 within --g 🧑‍🍳 .card__surface { --r: 42px; --g: 24px; border-radius: clamp( 0px, (100vi - 100cqi) / 2 * var(--r) / var(--g), var(--r) ); }

115,316 次观看 • 2 个月前 •via X (Twitter)

12 条评论

Ruan 的头像
Ruan2 个月前

fun, polaris does it

David Weiszfeld 的头像
David Weiszfeld2 个月前

Doesn't this break your design system ? Or you apply it to all components (cards / btns / etc.. ) ?

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ2 个月前

definitely a "case by case" type thing for example, makes for a pretty nice touch on a hero section container 🤙

aiu 的头像
aiu2 个月前

one day, an ai will be build in your image

Dannie Vinther 的头像
Dannie Vinther2 个月前

Nice touch. Conveniently, `progress()` will be Baseline Widely Available by next week, making this even easier.

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ2 个月前

yeah, progress() is a nice one 💯 perhaps not "easier", but def more "verbose" as will likely still need the clamp 🤙

Dannie Vinther 的头像
Dannie Vinther2 个月前

AFAIK progress() clamps the value by default unless you use no-clamp

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ2 个月前

ahh yes, it's the opposite way around, i forget that the clamp param came in later 🤙

Travis Fischer 的头像
Travis Fischer2 个月前

this is indeed sexy :) the software eng in me worries this is a code smell though trying to be clever in one line that which would be better achieved via explicit breakpoints over more lines -- a heuristic which is even more important these days w AI code gen

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ2 个月前

wouldn't say it was a code smell, it' just a detail ai is more than capable of understanding/producing this snippet as well

phatg 的头像
phatg2 个月前

oh my...I didn't even know vi and cqi exist

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ2 个月前

some other good ones too out there! cqmin/max are great!

相关视频

P O R N O G R A F I A
0:58

Sensitive content

P O R N O G R A F I A

Mauro

862,334 次观看 • 1 年前

R I G G E D 💀
0:56

Sensitive content

R I G G E D 💀

Ebiko 🧡🦐 Prawnstar

57,878 次观看 • 3 个月前