Загрузка видео...

Не удалось загрузить видео

На главную

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 месяцев назад