CSS trick: Dynamically adjust border radius based on available space

jh3yy · x · 2026-08-27

A useful CSS technique is shared to adaptively adjust an element's border radius based on available space. The radius shrinks to zero when the element fills the screen and maintains its value in smaller spaces. The code uses clamp with 100vi and 100cqi to detect the difference between viewport and container dimensions for a smooth transition.

Original post →

More from Apps

Apps channel →