emilkowalski / vaul

A drawer component for React.
https://vaul.emilkowal.ski
MIT License
6.45k stars 215 forks source link

Can I use negative values for snapPoints or set a top margin in pixels? #456

Closed suu3 closed 1 month ago

suu3 commented 1 month ago

Hello, I'd like to set the maximum height of snapPoints to be 40px less from the top. I'm wondering if there's a way to use something like calc(100vh - 40px) within snapPoints.

shaunkickbusch commented 1 month ago

This behavior can work by adding !h[100dvh] onto Drawer.Content and then h-[calc(100dvh-40px)] on the child inside the content. h-[calc(100dvh-40px)] is conditionally applied to the Drawer.Content child when the snappoint is 1 within my application.

suu3 commented 1 month ago

Thanks! I'll close this issue.