Problem/Motivation
Modal dialogs does not good on small screens. They have different behaviors depending where they are, but some problems we haver are:
* On *admin/structure/block*, modal appears on edit disabled blocks. The width of the modal window is fixed by JS, so on smaller windows we lost a part of the modal.
* On *admin/structure/views/view/content*. The width on the modal window is fixed to 50%, and the left positions i calculated on resize. Maybe we could use this margin for the modal itself.


Proposed resolution
Modal dialog should have a common behavior on all its appearances in mobile devices / small screens.
Comments
Comment #1
ckrinaComment #2
sqndr commentedThe screenshots are taken with the patch from #2113911 applied to it. Just a notice. Problem also occurs without the patch.
Comment #3
sqndr commentedComment #4
ckrinaAdded a patch to solve that problem that will apply on all
.ui-dialogaddingmax-widthandmin-widthon small devices:Important: This patch needs to be applied after the parent issue #2113911 patch 2113911-modal-style-22.patch because the file core/misc/dialog.theme.css is moved to core/themes/seven/dialog.theme.css.
Comment #5
ckrinaComment #6
ckrinaReady for some test, updating status.
Comment #8
ckrinaRemoved
min-widthbecause I don't see it necessary, and adapted the patch to the current d8 branch to pass the test.Comment #9
Bojhan commentedIs there any reason there is soo much space on the left/right?
Comment #10
Bojhan commentedComment #11
Bojhan commentedComment #12
merilainen commentedBefore you bash me completely for using !important, let me explain myself.
The popup gets a default width: 700 from core/modules/block/src/BlockListBuilder.php and core/modules/config/src/Form/ConfigSys.php, which makes it impossible to change it in css without !important. Removing those default values in mentioned files leads to the dialog getting a default width: 300 from core/assets/vendor/jquery.ui/ui/jquery.ui.dialog.js, which I presume is not to be altered. Using width:auto or width: "92%" in the php files means that the dialog gets very big in wider displays. Hence the !important, yuck.
Attached after.png.
Comment #14
lewisnymanThe Seven CSS files have moved. I'm happy with using the !important in this situation. jQuery UI styling makes me sad :(
Comment #16
sqndr commentedIs there a reason why we are doing the same thing twice?
Update Oh, I see. The stylesheet gets overridden in Seven.
Comment #17
g.i.joe commentedI will look into this issue.
Comment #18
g.i.joe commentedI sat next to sqndr @drupalcon Amsterdam. Where I rerolled this patch.
Comment #19
lauriiiThanks @G.I.Joe for the patch!
Seven:

Bartik:

Stark/Classy:

Comment #20
alexpottComment #21
lauriiiComment #22
alexpottCommitted 5ed7af8 and pushed to 8.0.x. Thanks!
The
!importantmakes me sad.