Page MenuHomePhabricator

[web] Center modals vertically
ClosedPublic

Authored by jacek on Apr 8 2022, 4:20 AM.
Tags
None
Referenced Files
F3178217: D3666.id11876.diff
Fri, Nov 8, 1:16 AM
F3178160: D3666.id11921.diff
Fri, Nov 8, 1:06 AM
Unknown Object (File)
Tue, Nov 5, 4:10 AM
Unknown Object (File)
Tue, Nov 5, 4:10 AM
Unknown Object (File)
Tue, Nov 5, 4:10 AM
Unknown Object (File)
Tue, Nov 5, 4:10 AM
Unknown Object (File)
Tue, Nov 5, 4:10 AM
Unknown Object (File)
Tue, Nov 5, 4:04 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
Lint Not Applicable
Unit
Tests Not Applicable

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)

web/modals/modal.css
12 ↗(On Diff #11223)
This revision now requires changes to proceed.Apr 8 2022, 10:33 AM
web/modals/modal.css
12 ↗(On Diff #11223)

What's the impact on performance of each approach?

jacek added inline comments.
web/modals/modal.css
12 ↗(On Diff #11223)

@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 ↗(On Diff #11223)

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.