Page MenuHomePhabricator

[web] Center modals vertically
ClosedPublic

Authored by jacek on Apr 8 2022, 4:20 AM.
Tags
None
Referenced Files
F3579714: D3666.diff
Sun, Dec 29, 3:18 AM
Unknown Object (File)
Sat, Dec 21, 4:36 AM
Unknown Object (File)
Thu, Dec 19, 12:40 PM
Unknown Object (File)
Sat, Dec 7, 9:52 PM
Unknown Object (File)
Nov 8 2024, 12:44 PM
Unknown Object (File)
Nov 8 2024, 5:05 AM
Unknown Object (File)
Nov 8 2024, 2:05 AM
Unknown Object (File)
Nov 8 2024, 1:16 AM

Details

Summary

According to the designs, modals should be centered vertically. The change removes static top margin and centers the modal component

Test Plan

In web app, all existing modals should display in the center of view.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

This revision is now accepted and ready to land.Apr 8 2022, 10:31 AM

(would be helpful to attach a screenshot for diffs like this in the future)

This revision now requires changes to proceed.Apr 8 2022, 10:33 AM
web/modals/modal.css
12

What's the impact on performance of each approach?

jacek added inline comments.
web/modals/modal.css
12

@benschac Why is transform: translate(...) better here?
We would have to introduce position absolute and top: 50%, left: 50%, on modal-container, to use it, don't we?
As we already use flex positioning inside modal-overlay and center horizontally using align-items, using justify-content to center vertically seems to be a natural solution for me, and it's simple.
Doesn't transforms have worse performance that aligning with flex?

benschac added inline comments.
web/modals/modal.css
12

I googled around a bit more. This CSS makes sense and is a bit more readable. I don't think there's added benefit to my previous suggestion. Sorry about that.

This revision is now accepted and ready to land.Apr 14 2022, 2:42 PM
This revision was automatically updated to reflect the committed changes.