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).

20.modal-dialog.png

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

View all styleguide issues

CommentFileSizeAuthor
#76 Screenshot 2014-06-02 10.13.50.jpg275.99 KBLewisNyman
#75 drupal8-modal_style_update-2113911-75.patch33.32 KBLewisNyman
#75 interdiff.txt472 bytesLewisNyman
#74 modal-bottom.png33.5 KBBojhan
#72 drupal8-modal_style_update-2113911-71.patch32.86 KBolemedia
#65 Screenshot 2014-05-22 16.10.55.jpg132.72 KBLewisNyman
#65 Screenshot 2014-05-22 16.10.33.jpg238.11 KBLewisNyman
#64 interdiff-64.txt1.29 KBManuel Garcia
#64 drupal8-modal_style_update-2113911-64.patch32.91 KBManuel Garcia
#61 interdiff-61.txt461 bytesManuel Garcia
#61 drupal8-modal_style_update-2113911-61.patch31.63 KBManuel Garcia
#60 drupal8-modal_style_update-2113911-60.patch31.54 KBManuel Garcia
#60 interdiff.txt423 bytesManuel Garcia
#58 Screenshot 2014-05-16 12.48.39.jpg269.53 KBLewisNyman
20.modal-dialog.png42.41 KBLewisNyman
#3 modal-style.2113911-3.patch2.42 KBLewisNyman
#4 core-modal-style-2113911-4.patch31.79 KBnod_
#7 core-js-modal-style-2113911-7.patch7.7 KBnod_
#10 core-js-modal-style-2113911-10.patch10.78 KBnod_
#11 interdiff.txt1.2 KBLewisNyman
#11 core-js-modal-style-2113911-11.patch33.59 KBLewisNyman
#17 core-js-modal-style-2113911-17.patch32.8 KBLewisNyman
#18 core-js-modal-style-2113911-18.patch10.46 KBLewisNyman
#19 2113911-modal-style-19.patch10.7 KBlongwave
#19 interdiff-2113911.txt830 byteslongwave
#21 2113911-modal-style-21.patch11.57 KBlongwave
#21 interdiff-2113911.txt883 byteslongwave
#22 modal-before.png53.38 KBrteijeiro
#22 modal-after.png53.39 KBrteijeiro
#22 2113911-modal-style-22.patch33.93 KBrteijeiro
#22 interdiff.txt643 bytesrteijeiro
#32 bartik-ugly.png37.78 KBnod_
#32 contrast.png36.71 KBnod_
#35 dialog-stark.png68.57 KBsun
#38 2113911-modal-style-38.patch32.3 KBLewisNyman
#40 2113911-modal-style-40.patch31.44 KBLewisNyman
#40 Screenshot 2014-03-27 23.56.17.jpg156.21 KBLewisNyman
#40 Screenshot 2014-03-27 23.56.53.jpg158.97 KBLewisNyman
#40 Screenshot 2014-03-27 23.57.11.jpg168.45 KBLewisNyman
#44 drupal8-modal_style_update-2113911-44.patch16.9 KBRajendar Reddy
#47 drupal8-modal_style_update-2113911-47.patch31.04 KBRajendar Reddy
#50 drupal8-modal_style_update-2113911-50.patch31.44 KBRajendar Reddy
#51 Screenshot 2014-04-11 16.27.58.jpg222.89 KBLewisNyman
#52 interdiff.txt1.48 KBLewisNyman
#52 drupal8-modal_style_update-2113911-52.patch31.47 KBLewisNyman
#53 2113911_screen-node-add-image.png33.47 KBtompagabor
#53 2113911_screen-add-block.png83.18 KBtompagabor
#56 interdiff-2113911-52-55.txt426 bytespakmanlh
#56 drupal8-modal_style_update-2113911-55.patch31.55 KBpakmanlh
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

LewisNyman’s picture

I've added the tag 'needs-test-pages' because we need a few more examples of the modal in action in the issue summary.

nod_’s picture

The views dialog needs to be mocked up, there are a lot of things going on in them.

LewisNyman’s picture

Status: Active » Needs review
FileSize
2.42 KB

I 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.

LewisNyman’s picture

Issue summary: View changes

Added block page

nod_’s picture

Issue summary: View changes
Issue tags: +JavaScript
FileSize
31.79 KB

Rolled #2173129: Modal dialog style update in this one. scott.gonzalez needs to be given commit credit.

Wim Leers’s picture

Why did we close that other issue in favor of this one? Much more activity in the other one…

nod_’s picture

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.

nod_’s picture

FileSize
7.7 KB

Same patch but with the moved files obvious.

clemens.tolboom’s picture

When switching from the comment body field for ie an article

  • the ugly dialog appears
  • a red artifact when switching to 'Restricted HTML'

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?

clemens.tolboom’s picture

nod_’s picture

FileSize
10.78 KB

This is a reroll because the indentation standard changed for JavaScript files. No need for commit credit because of this reroll.

LewisNyman’s picture

FileSize
1.2 KB
33.59 KB

Some of the selectors from the original jQueryUI css were overwriting the Seven CSS. This should look better.

Status: Needs review » Needs work

The last submitted patch, 11: core-js-modal-style-2113911-11.patch, failed testing.

The last submitted patch, 11: core-js-modal-style-2113911-11.patch, failed testing.

LewisNyman’s picture

Status: Needs work » Needs review
LewisNyman’s picture

Status: Needs review » Needs work

The last submitted patch, 11: core-js-modal-style-2113911-11.patch, failed testing.

LewisNyman’s picture

Status: Needs work » Needs review
FileSize
32.8 KB
LewisNyman’s picture

FileSize
10.46 KB

Here's a smaller version of the same patch. Thanks @longwave!

longwave’s picture

FileSize
10.7 KB
830 bytes

This 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.

Status: Needs review » Needs work

The last submitted patch, 19: 2113911-modal-style-19.patch, failed testing.

longwave’s picture

Status: Needs work » Needs review
FileSize
11.57 KB
883 bytes

ThemeHandlerTest explictly looks for Seven's CSS. Still not sure this is the right approach to getting dialog.theme.css loaded.

rteijeiro’s picture

FileSize
53.38 KB
53.39 KB
33.93 KB
643 bytes

Reduced modal window title padding from 20px to 15px after discussing with @lewisnyman. Now it looks better (see screenshots).

Before

After

rteijeiro’s picture

Sorry for the junk in previous patch. I have to configure git for deleted files :(

sqndr’s picture

Status: Needs review » Needs work

Patch seems to work. Been testing this a lot now. Looks fine to me. Hope someone else could confirm and we can get this RTBC!

sqndr’s picture

Status: Needs work » Needs review
Coornail’s picture

Looks good to me!

ckrina’s picture

Patch 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

jjcarrion’s picture

Status: Needs review » Reviewed & tested by the community

It works good to me!

webchick’s picture

Status: Reviewed & tested by the community » Fixed

As 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!

  • Commit 5a8a34e on 8.x by webchick:
    Issue #2113911 by LewisNyman, longwave, nod_, rteijeiro: Modal style...
Bojhan’s picture

@webchick Thats because the before picture is wrong, hah :)

nod_’s picture

Status: Fixed » Needs work
FileSize
37.78 KB
36.71 KB

Tempted to reopen, see attached files.

Contrast too low on modal header.
Modals look like crap on bartik.

LewisNyman’s picture

I 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.

LewisNyman’s picture

Status: Needs work » Fixed
Issue tags: -needs-test-pages

I'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.

sun’s picture

Status: Fixed » Active
FileSize
68.57 KB

Sorry, friends, I have to re-open this...

  1. --- a/core/misc/dialog.theme.css
    

    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.

  2. +++ b/core/themes/seven/dialog.theme.css
    

    Seven has a ./css folder — why are we not using it?

  3. +++ b/core/themes/seven/seven.info.yml
    @@ -10,6 +10,7 @@ stylesheets:
    +    - dialog.theme.css
    

    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.

  • Commit e0f3aa3 on 8.x by webchick:
    Revert "Issue #2113911 by LewisNyman, longwave, nod_, rteijeiro: Modal...
webchick’s picture

Status: Active » Needs work

Ok, since it sounds like this still needs work/discussion, rolled this back for now.

LewisNyman’s picture

Status: Needs work » Needs review
FileSize
32.3 KB

Makes sense to me.

Status: Needs review » Needs work

The last submitted patch, 38: 2113911-modal-style-38.patch, failed testing.

LewisNyman’s picture

Ah, 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.

sqndr’s picture

Nice, 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.

nod_’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me too.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 40: 2113911-modal-style-40.patch, failed testing.

Rajendar Reddy’s picture

Assigned: Unassigned » Rajendar Reddy
FileSize
16.9 KB

Updating patch with reroll, please review.

nod_’s picture

Status: Needs work » Needs review
wiifm’s picture

Status: Needs review » Needs work

Yeah, 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:

GET http://s524bf474844c1cc.s2.simplytest.me/core/themes/seven/css/dialog.theme.css?n3nmhw 404 (Not Found) page:53
GET http://s524bf474844c1cc.s2.simplytest.me/core/misc/dialog/dialog.js?v=8.0-dev 404 (Not Found) VM617 page:99
GET http://s524bf474844c1cc.s2.simplytest.me/core/misc/dialog/dialog.position.js?v=8.0-dev 404 (Not Found) VM617 page:100
GET http://s524bf474844c1cc.s2.simplytest.me/core/misc/dialog/dialog.jquery-ui.js?v=8.0-dev 404 (Not Found) 

Please re-roll ;)

Rajendar Reddy’s picture

;) updating the patch with required files.

Rajendar Reddy’s picture

Status: Needs work » Needs review
LewisNyman’s picture

Status: Needs review » Needs work

I 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

Rajendar Reddy’s picture

Status: Needs work » Needs review
FileSize
31.44 KB

rerolling...

LewisNyman’s picture

Status: Needs review » Needs work
FileSize
222.89 KB

I'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.

LewisNyman’s picture

Status: Needs work » Needs review
FileSize
1.48 KB
31.47 KB

Ok, looks like we needed to remove jquery.ui.dialog.css as well. Yay for a lighter

tompagabor’s picture

Status: Needs review » Needs work
FileSize
33.47 KB
83.18 KB

Stat 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:

 (views_ui.admin.theme.css:864)
.views-ui-dialog .views-override {
padding: 8px 13px;
}

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 of overflow: hidden;.

Rajendar Reddy’s picture

Assigned: Rajendar Reddy » Unassigned
pakmanlh’s picture

Assigned: Unassigned » pakmanlh
Issue tags: +DrupalCampSpain
pakmanlh’s picture

Status: Needs work » Needs review
FileSize
31.55 KB
426 bytes

Here attached rerolled patch and applying the overflow and padding to fix the issues in #53.
Cheers!

pakmanlh’s picture

Assigned: pakmanlh » Unassigned
LewisNyman’s picture

Status: Needs review » Needs work
FileSize
269.53 KB

hmm 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

The last submitted patch, 56: drupal8-modal_style_update-2113911-55.patch, failed testing.

Manuel Garcia’s picture

Status: Needs work » Needs review
FileSize
423 bytes
31.54 KB

Here is a patch on #56 with the removed padding.

Manuel Garcia’s picture

OK, 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.

Status: Needs review » Needs work

The last submitted patch, 61: drupal8-modal_style_update-2113911-61.patch, failed testing.

The last submitted patch, 60: drupal8-modal_style_update-2113911-60.patch, failed testing.

Manuel Garcia’s picture

Status: Needs work » Needs review
FileSize
32.91 KB
1.29 KB

Updating the failing test (path change).

LewisNyman’s picture

This is looking good for me. Here are some screenshots. Feels much easier to test now that we aren't touching any system styles.

Bojhan’s picture

Assigned: Unassigned » sun
Status: Needs review » Reviewed & tested by the community

Wonder if @sun could give it another last review. I dont want to roll it back again.

Bojhan’s picture

Status: Reviewed & tested by the community » Needs review
Bojhan’s picture

Status: Needs review » Needs work

The last submitted patch, 64: drupal8-modal_style_update-2113911-64.patch, failed testing.

Bojhan’s picture

Issue tags: +frontend, +Needs reroll
Bojhan’s picture

Looks like DialogTest.php moved?

olemedia’s picture

Assigned: sun » Unassigned
Issue tags: -Needs reroll
FileSize
32.86 KB

patch reroll to the working state

olemedia’s picture

Status: Needs work » Needs review

changing status to needs review

Bojhan’s picture

FileSize
33.5 KB

Looks 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

LewisNyman’s picture

Oh 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.

LewisNyman’s picture

Screenie:

Bojhan’s picture

Status: Needs review » Reviewed & tested by the community

Alright, 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.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 22b7b7e and pushed to 8.x. Thanks!

diff --git a/core/modules/ckeditor/js/ckeditor.admin.js b/core/modules/ckeditor/js/ckeditor.admin.js
index 524d429..4136424 100644
--- a/core/modules/ckeditor/js/ckeditor.admin.js
+++ b/core/modules/ckeditor/js/ckeditor.admin.js
@@ -1361,7 +1361,7 @@
           text: Drupal.t('Cancel'),
           click: function () {
             closeDialog('cancel');
-          },
+          }
         }
       ],
       open: function () {

This broke our eslint rules :) - fixed during commit.

core/modules/ckeditor/js/ckeditor.admin.js
  1364:11  error  Trailing comma  no-comma-dangle

  • Commit 22b7b7e on 8.x by alexpott:
    Issue #2113911 by LewisNyman, Manuel Garcia, longwave, nod_, Rajendar...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.