fix: anchor 160px from top, center on small viewports#809
Conversation
Replaces the always-centered positioning of Dialog and AlertDialog with a 160px top offset on tall viewports, falling back to vertical centering when the viewport is too short to fit the offset. The whole vertical position is expressed as `translateY(min(160px, calc(50vh - 50%)))` so the transition between the two modes happens smoothly on resize without media queries. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThis pull request updates dialog positioning and animation behavior in a single CSS module. The 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
160pxfrom the top of the viewport instead of being vertically centered.transform: translate(-50%, min(160px, calc(50vh - 50%))). The inner50%resolves to the element's own height, somin()smoothly switches between the 160px-anchored and centered positions as the viewport resizes.