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.
More from Apps
- LlamaParse adds native spreadsheet extraction to preserve structure — llama_index · 2026-08-28
- Workflow evolution: Chatting with Gemini inside Sheets replaces formulas — gaganghotra_ · 2026-08-28
- Google AI can now plan trips and book hotels, but cancellation policies bring it back to reality — HaktanSuren · 2026-08-28
- Automate UGC Testing with AI Agents While You Sleep — VibeMarketer_ · 2026-08-28
- shadcn/ui Releases New Sidebar and Drawer Components — shadcn · 2026-08-28
- Stream voice transcription enables comfortable usage in public — nwilliams030 · 2026-08-28