Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
We currently have no real styling for the modal in core, it was placed in with little to no styling. We propose to align this styling with the overlay, #1953374: Implement Seven style guide for core overlay, because conceptually they are not very different. Users often interact with the overlay just like a modal, and the modal is often something placed on top of the overlay (e.g., views).
Proposed resolution
This design may need to be tweaked and revisited depending on the fate of the Overlay.
Test Pages
- admin/structure/views/view/content
- admin/structure/block - add a block
Related Issues
Comment | File | Size | Author |
---|---|---|---|
#76 | Screenshot 2014-06-02 10.13.50.jpg | 275.99 KB | LewisNyman |
#75 | drupal8-modal_style_update-2113911-75.patch | 33.32 KB | LewisNyman |
#75 | interdiff.txt | 472 bytes | LewisNyman |
#74 | modal-bottom.png | 33.5 KB | Bojhan |
#72 | drupal8-modal_style_update-2113911-71.patch | 32.86 KB | olemedia |
Comments
Comment #1
LewisNymanI've added the tag 'needs-test-pages' because we need a few more examples of the modal in action in the issue summary.
Comment #2
nod_The views dialog needs to be mocked up, there are a lot of things going on in them.
Comment #3
LewisNymanI quickly styled this up how this would look so we can see how this would play with the Views UI styling. We're going to have to do a fair bit of design work to avoid any regressions.
Comment #3.0
LewisNymanAdded block page
Comment #4
nod_Rolled #2173129: Modal dialog style update in this one. scott.gonzalez needs to be given commit credit.
Comment #5
Wim LeersWhy did we close that other issue in favor of this one? Much more activity in the other one…
Comment #6
nod_The activity is Bojhan, you and me. doesn't matter which one we go with, this one is older and 6 people are following it, 4 on the other.
Comment #7
nod_Same patch but with the moved files obvious.
Comment #8
clemens.tolboomWhen switching from the comment body field for ie an article
As #2166399: Changing CKEditor configurations by changing text formats causes markup to be lost: warn the user when performing this advanced action is closed and this is mere styling let's fix it here?
Comment #9
clemens.tolboomComment #10
nod_This is a reroll because the indentation standard changed for JavaScript files. No need for commit credit because of this reroll.
Comment #11
LewisNymanSome of the selectors from the original jQueryUI css were overwriting the Seven CSS. This should look better.
Comment #14
LewisNyman11: core-js-modal-style-2113911-11.patch queued for re-testing.
Comment #15
LewisNyman11: core-js-modal-style-2113911-11.patch queued for re-testing.
Comment #17
LewisNymanAn attempt at a reroll after #1996238: Replace hook_library_info() by *.libraries.yml file
Comment #18
LewisNymanHere's a smaller version of the same patch. Thanks @longwave!
Comment #19
longwaveThis patch corrects the path to dialog.ajax.js and moves the Seven stylesheet so it's always included; it doesn't seem to work in the stylesheets-override section as there isn't a base dialog.theme.css to override any more.
Comment #21
longwaveThemeHandlerTest explictly looks for Seven's CSS. Still not sure this is the right approach to getting dialog.theme.css loaded.
Comment #22
rteijeiro CreditAttribution: rteijeiro commentedReduced modal window title padding from 20px to 15px after discussing with @lewisnyman. Now it looks better (see screenshots).
Before
After
Comment #23
rteijeiro CreditAttribution: rteijeiro commentedSorry for the junk in previous patch. I have to configure git for deleted files :(
Comment #24
sqndr CreditAttribution: sqndr commentedPatch seems to work. Been testing this a lot now. Looks fine to me. Hope someone else could confirm and we can get this RTBC!
Comment #25
sqndr CreditAttribution: sqndr commentedComment #26
Coornail CreditAttribution: Coornail commentedLooks good to me!
Comment #27
ckrinaPatch applies fine, but maybe it could need some work in responsive for small screens. I create a new issue for that: https://drupal.org/node/2225349
Comment #28
jjcarrionIt works good to me!
Comment #29
webchickAs a developer I can't really tell a difference between the OP and later screenshots, but yay for better looking thingies. :)
Committed and pushed to 8.x. Thanks!
Comment #31
Bojhan CreditAttribution: Bojhan commented@webchick Thats because the before picture is wrong, hah :)
Comment #32
nod_Tempted to reopen, see attached files.
Contrast too low on modal header.
Modals look like crap on bartik.
Comment #33
LewisNymanI think we should open a new issue to style the model in Bartik. We shouldn't have that kind of heavy styling in the module.
Comment #34
LewisNymanI've created #2226189: Style the modal in Bartik and #2226193: Discuss increasing the contrast of the Seven modal header.
In my mind the header contrast issue isn't an accessibility defect, so it wouldn't be worth rolling this patch back for.
Comment #35
sunSorry, friends, I have to re-open this...
Why was the default dialog.theme.css implementation removed here?
Dialogs appear even more distorted than previously in Stark now:
They had way too much chrome in the past already, but now their styling is completely off the mark.
Seven has a
./css
folder — why are we not using it?Why are we loading the dialog styles at all times?
If the library's default dialog.theme.css asset file wouldn't have been removed, then this would be a simple stylesheets-override and it would only be loaded when needed.
Comment #37
webchickOk, since it sounds like this still needs work/discussion, rolled this back for now.
Comment #38
LewisNymanMakes sense to me.
Comment #40
LewisNymanAh, I guess you don't need the stylesheet in the test if it's a stylesheet override.
Here are some screenshots of dialogs looking good in all themes.
Comment #41
sqndr CreditAttribution: sqndr commentedNice, seems like this fixed the problem. Been testing on Simplytest and it seems to work fine with all the themes, just like on the screenshots you've provided.
Comment #42
nod_Looks good to me too.
Comment #44
Rajendar Reddy CreditAttribution: Rajendar Reddy commentedUpdating patch with reroll, please review.
Comment #45
nod_Comment #46
wiifmYeah, looks like you straight forgot to add 3 JS files, and 1 CSS file into your last patch, comment #40 patch was over 30KB, your last is only 16 KB and in the console are messages:
Please re-roll ;)
Comment #47
Rajendar Reddy CreditAttribution: Rajendar Reddy commented;) updating the patch with required files.
Comment #48
Rajendar Reddy CreditAttribution: Rajendar Reddy commentedComment #49
LewisNymanI think we're missing the stylesheet override in the seven.theme.yml because the Seven stylesheet isn't being loaded. See the patch in #40
Comment #50
Rajendar Reddy CreditAttribution: Rajendar Reddy commentedrerolling...
Comment #51
LewisNymanI'm not sure what's happened here but the header looks a bit off. There's also a black line on the top of the button area.
Comment #52
LewisNymanOk, looks like we needed to remove jquery.ui.dialog.css as well. Yay for a lighter
Comment #53
tompagabor CreditAttribution: tompagabor commentedStat and bartik looks good.
Seven looks good at views.
The modal box looks bad at add block modal window, and the add image modal on node create form.
The views add padding to the form element:
But the node form doesn't.
In the views modal, there's an
overflow: hidden;
inline value on the #drupal-modal. Maybe we need to add this from css.If the dialog is too small, i can't scroll inside it. We could add
overflow:scroll;
instead ofoverflow: hidden;
.Comment #54
Rajendar Reddy CreditAttribution: Rajendar Reddy commentedComment #55
pakmanlhComment #56
pakmanlhHere attached rerolled patch and applying the overflow and padding to fix the issues in #53.
Cheers!
Comment #57
pakmanlhComment #58
LewisNymanhmm the spacing around the edges are looking a bit weird for me, they should reach the edges of the modal, like they did in #51. Look at the screenshot here: https://drupal.org/node/2113911#comment-8533115
Comment #60
Manuel Garcia CreditAttribution: Manuel Garcia commentedHere is a patch on #56 with the removed padding.
Comment #61
Manuel Garcia CreditAttribution: Manuel Garcia commentedOK, that padding was needed for the dialog somewhere else, so here is a patch with it, undoing it for views modal dialogs.
The interdiff is done against #56.
Comment #64
Manuel Garcia CreditAttribution: Manuel Garcia commentedUpdating the failing test (path change).
Comment #65
LewisNymanThis is looking good for me. Here are some screenshots. Feels much easier to test now that we aren't touching any system styles.
Comment #66
Bojhan CreditAttribution: Bojhan commentedWonder if @sun could give it another last review. I dont want to roll it back again.
Comment #67
Bojhan CreditAttribution: Bojhan commentedComment #68
Bojhan CreditAttribution: Bojhan commented64: drupal8-modal_style_update-2113911-64.patch queued for re-testing.
Comment #70
Bojhan CreditAttribution: Bojhan commentedComment #71
Bojhan CreditAttribution: Bojhan commentedLooks like DialogTest.php moved?
Comment #72
olemedia CreditAttribution: olemedia commentedpatch reroll to the working state
Comment #73
olemedia CreditAttribution: olemedia commentedchanging status to needs review
Comment #74
Bojhan CreditAttribution: Bojhan commentedLooks like something is wrong with the bottom of a view dialog.
This wasn't there in the previous patch, did something change? The white space just above the button
Comment #75
LewisNymanOh yeah. I didn't spend time figuring out what changed, theres an invisible form being printed at the bottom of the modal. I removed some padding from the container.
Comment #76
LewisNymanScreenie:
Comment #77
Bojhan CreditAttribution: Bojhan commentedAlright, I didn't spot anything else. So I am going to mark this RTBC. It looks like @sun doesn't have the time to review this atm, so I think we can just put it in core.
Comment #78
alexpottCommitted 22b7b7e and pushed to 8.x. Thanks!
This broke our eslint rules :) - fixed during commit.