Updated: Comment #0

Problem/Motivation

We do use Drupal's dialog in Drupal-specific CKEditor plugins, like the image and link plugins.

We don't do that for other functionality, like

  1. the table plugin, which shows a CKEditor dialog:
  2. the "Source" button, which shows a CKEditor dialog when using CKEditor in in-place editing: Screen Shot 2013-09-17 at 12.48.09.png

(WordPress does this too for TinyMCE's dialogs, see #1879120-39: Use Drupal-specific image and link plugins — use core dialogs rather than CKEditor dialogs, containing alterable Drupal forms.)

Proposed resolution

Make CKEditor dialog styling match Drupal's dialog styling.

Remaining tasks

None.

User interface changes

CKEditor's dialog styling overridden in Seven.

Before
After

API changes

None.

The first 20 or so comments in #1879120: Use Drupal-specific image and link plugins — use core dialogs rather than CKEditor dialogs, containing alterable Drupal forms.

CommentFileSizeAuthor
#105 interdiff-2090937-98-105.txt1.49 KBdarketaine
#105 2090937-105.patch8.62 KBdarketaine
#98 interdiff-2090937-89-98.txt4.57 KBdarketaine
#98 2090937-98.patch8.41 KBdarketaine
#96 2090937-95-close-icon.png64.7 KBstar-szr
#89 2090937-4.png22.1 KBthpoul
#89 2090937-89.patch7.55 KBthpoul
#89 interdiff-2090937-85-89.txt6.64 KBthpoul
#89 2090937-3.png22.6 KBthpoul
#89 2090937-2.png23.1 KBthpoul
#89 2090937-1.png23.84 KBthpoul
#85 2090937-85.patch6.87 KBthpoul
#85 interdiff-2090937-74-85.txt1.37 KBthpoul
#77 interdiff-70-74.txt734 byteshimanshugautam
#74 2090937-74.patch6.86 KBhimanshugautam
#70 interdiff-67-70.txt730 bytesdarketaine
#70 2090937-70.patch6.76 KBdarketaine
#67 2090937-67.patch6.7 KBdarketaine
#67 interdiff-25-67.txt894 bytesdarketaine
#63 interdiff.txt1008 byteskostyashupenko
#63 seven_theme_style-2090937-63.patch6.64 KBkostyashupenko
#63 after.png6.33 KBkostyashupenko
#63 before.png6.5 KBkostyashupenko
#61 2090937-dialog-title.png18.67 KBstar-szr
#61 2090937-button-height.png11.36 KBstar-szr
#60 cke-native-dialog-after.png98.32 KBWim Leers
#60 cke-native-dialog-before.png100.62 KBWim Leers
#60 2090937-25.patch6.64 KBWim Leers
#48 interdiff-2090937-25-42.txt3.24 KBironkiat
#46 dialog_compare_35-41.jpg71.5 KBironkiat
#41 2090937-42.patch9.99 KBironkiat
#39 Test___D8_Dev.jpg41.21 KBironkiat
#37 Screenshot_21_2_16__2_58_PM.jpg42.85 KBironkiat
#37 2090937-37.patch9.92 KBironkiat
#34 Screen Shot 2016-02-19 at 1.50.58 PM.png29.26 KBdavidhernandez
#34 Screen Shot 2016-02-19 at 1.50.14 PM.png24.65 KBdavidhernandez
#25 2090937-25.patch6.64 KBdarketaine
#25 interdiff-2090937-19-25.txt1.64 KBdarketaine
#19 Screen Shot 2016-02-19 at 11.54.12.png114.77 KBdarketaine
#19 2090937-19.patch6.8 KBdarketaine
#19 interdiff-2090937-15-19.txt6.01 KBdarketaine
#15 Screen Shot 2016-02-18 at 17.48.23.png27.14 KBWim Leers
#15 ckeditor-dialog-seven-2090937-15.patch1.34 KBWim Leers
#1 Screen Shot 2014-08-14 at 21.27.38.png166.82 KBWim Leers
Screen Shot 2013-09-17 at 12.48.09.png86.45 KBWim Leers
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Wim Leers’s picture

Component: ckeditor.module » theme system
Issue summary: View changes
Issue tags: +Usability, +Seven
Related issues: +#1879120: Use Drupal-specific image and link plugins — use core dialogs rather than CKEditor dialogs, containing alterable Drupal forms
FileSize
166.82 KB

I think perhaps this is not getting the necessary love because it lives in the CKEditor module component. Moving to a more appropriate component, and updating the issue summary.

LewisNyman’s picture

+1, makes sense. Are we able to modify the mark up for this dialog or do we have to duplicate styling?

Wim Leers’s picture

Modifying the markup is sadly impossible, so the styling will have to be duplicated.

LewisNyman’s picture

Issue tags: +styleguide, +frontend, +CSS

Let's do this.

Wim Leers’s picture

Actually, come to think of it, it might be possible to modify the markup of CKEditor's dialogs… See https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/dialog/plug.... I'll ping the CKEditor guys and ask them to comment here.

Reinmar’s picture

The variable (dialog template) that you mentioned Wim is private, so in order to make it overridable, we would need to move it to some public object. We could do that without any trouble, but... :D

I don't think that playing with the dialog system's underlaying DOM structure will be safe and useful. I've never worked a lot with this part of CKEditor, but I can already think of few reasons:

  • The dialog system didn't even lay close to the MVC pattern, so there's no view layer separation. The template you found is the only so big chunk of HTML I found - the rest is scattered over the entire dialog and dialogui plugins. It wouldn't be possible now to make all them overridable.
  • Some dialogs may depend on specific DOM structures, so changing them might break those dialogs. Also, where CSS's powers were too weak, some JS might be used.
  • The dialog system originally supported IE6+ and while we got rid of the code that was directly related to those old browsers the major design decisions remained. For instance, the whole system is based on tables and if you don't want them... well :D.
  • Any changes to the templates will need to be maintained in the future. We still improve dialogs accessibility or add new features.

Of course, I assumed that you want to change all the templates. If you just want to change the main one the situation may be much simpler, but is it still worth it? Therefore, I would change the stylesheets only to make the CKEditor's components resemble Drupal's ones.

Wim Leers’s picture

Thank you very much for the very thorough explanation! :) Looks like my original statement in #3 was correct after all :)


Of course, I assumed that you want to change all the templates. If you just want to change the main one the situation may be much simpler, but is it still worth it?

I don't know what this means exactly. I'd think we'd only want to modify the wrapper markup, i.e. the "skeleton" of the dialog, not the "filler" of each dialog.

Reinmar’s picture

I don't know what this means exactly. I'd think we'd only want to modify the wrapper markup, i.e. the "skeleton" of the dialog, not the "filler" of each dialog.

Ah, ok. I thought that you might want to modify the contents, because that's theoretically also doable. Dialog definitions do not (usually) contain any markup, but they use CKEditor's ui components definitions and these components can be overridden. However, that's doable only theoretically because of no view layer separation and thus huge amount of work.

As for the wrapper, if you'll find it hard to achieve some result without changing the skeleton, I don't see a problem in exposing (by the dialog plugin) the skeleton's template.

Wim Leers’s picture

[…] I don't see a problem in exposing (by the dialog plugin) the skeleton's template.

I take it this means this is not yet the case?

Wim Leers’s picture

Version: 8.0.x-dev » 8.1.x-dev
Component: theme system » ckeditor.module

I totally lost track of this because it's in the very generic theme system component.

Bojhan’s picture

How hard is this to change?

@wim could you provde some guidance?

Wim Leers’s picture

Pinged the CKEditor team to point us to the relevant docs.

Reinmar’s picture

We don't have any documentation for styling dialogs. We have only a generic documentation regarding skins and creating a new skin: http://docs.ckeditor.com/#!/guide/skin_sdk_intro. I think it should be enough for you because it's just a CSS. I would propose two approaches:

  • Overriding the default skin without touching the original files. This will make future upgrades super easy, but may be a bit cumbersome (because it's CSS...).
  • Forking the original skin and making your modifications in dialog.css. This will allow for deeper modifications and will be more optimal in terms of the code size, but future upgrades will be trickier.

So it boils down to the question of how much you'll need to change the skin.

Wim Leers’s picture

Thanks, that's clear!

Wim Leers’s picture

So #13 made this a CSS-only issue.

The attached patch takes away the non-CSS aspects of it. It just makes CKEditor's dialogs have a 5px solid red border. All that is left to be done, is make it look exactly like Seven's dialogs :)

This is what this patch makes it look like:

Wim Leers’s picture

sarah_p’s picture

I can do it if it's not a critical turnaround, would probably be tomorrow or at the latest over the weekend.

Wim Leers’s picture

Not at all critical :) Take your time.

It'd just be lovely to have this fixed in Drupal 8.1 for those who for example frequently create HTML tables in CKEditor.

Thanks for stepping up — much appreciated!

darketaine’s picture

Status: Active » Needs review
Issue tags: +Classy
FileSize
6.01 KB
6.8 KB
114.77 KB

Will try and move this forward. This is a first approach for the table plugin, which shows a CKEditor dialog. The "Source" button, which shows a CKEditor dialog when using CKEditor in in-place editing takes the current theme's styling so in this case it should be added at classy (tagging accordingly).

@Wim Leers: should I move on and do the same for classy?

Wim Leers’s picture

Wow! This is night & day :) This looks awesome!

However, since I'm neither a CSS expert, nor the maintainer of the Seven theme, I think this is going to need sign-off from a strong front-end person. Preferably Cottser would be the committer of this issue/patch. I'll ping a bunch of people to hopefully get reviews of the CSS itself.

I personally found just a few small remarks. But again, a person with stronger CSS skills should review this:

  1. +++ b/core/themes/seven/css/theme/ckeditor-dialog.css
    @@ -0,0 +1,195 @@
    +  filter: Alpha(Opacity=70);
    

    Isn't this something that's only necessary for old IE? (D8 doesn't support old IE)

  2. +++ b/core/themes/seven/css/theme/ckeditor-dialog.css
    @@ -0,0 +1,195 @@
    +.cke_reset_all .cke_dialog_body input[type="password"],
    ...
    +.cke_reset_all .cke_dialog_body input[type="password"]:focus,
    

    Why separately target password inputs? I can't imagine ever having to enter a password in a CKEditor dialog. Why not just target all inputs?

  3. +++ b/core/themes/seven/css/theme/ckeditor-dialog.css
    @@ -0,0 +1,195 @@
    \ No newline at end of file
    

    Can you please insert the missing newline at the very end of the file?

Wim Leers’s picture

Assigned: Unassigned » star-szr

Oh, and I also am not sure what to answer to your Classy question. This is quite an edge case, so I defer to the front-end committer Cottser to decide that.

tic2000’s picture

+  background: url(/core/misc/icons/ffffff/ex.svg) 0 0 no-repeat;

This and all other urls like that will not work if drupal is in a folder.

tic2000’s picture

Status: Needs review » Needs work
darketaine’s picture

@Wim Leers for the first one, I tried to stay inline with /core/assets/vendor/jquery.ui/themes/base/theme.css which still uses this, but yeah probably it's not needed anymore. The second one is extreme to have it in a CKEditor dialog, indeed.

@tic2000 I tried to stay inline with /core/themes/seven/css/components/dialog.css. I know that this will happen, but maybe it's a matter we should discuss for theming in general as it's used in core themes already.

darketaine’s picture

Status: Needs work » Needs review
FileSize
1.64 KB
6.64 KB

New patch after #20 and #22 suggestions :)

Wim Leers’s picture

#24: What's in core/assets/vendor/jquery.ui is vendor code, i.e. upstream: from jQuery UI. We don't modify it, even if there's things in there we don't need.

#25: looks great to me! I have no further feedback. This now needs review from a strong front-end/CSS person.

davidhernandez’s picture

Issue summary: View changes

Should these be added not with a library, but using the ckeditor settings in the info file, or is that deprecated?

Bartik still has it...

ckeditor_stylesheets:
  - css/base/elements.css
  - css/components/captions.css
  - css/components/table.css

Regarding Classy, I'm not sure that is the appropriate place for this. Classy, as far as I can tell, does not have any ckeditor specific styling. It only has the more generic dialog css, and extends core's dialog library, not the ckeditor one. If the argument is that all dialogs, regardless of implementation should have this styling, is there a way we can have quickedit load the library?

davidhernandez’s picture

Issue summary: View changes

Sorry, didn't mean to ember those images.

Wim Leers’s picture

#27: ckeditor_stylesheets is for stylesheets loaded inside CKEditor, i.e. in its iframe, i.e. to style the HTML that you're editing.

The dialog lives in the parent document.

So they're entirely separate things.

davidhernandez’s picture

Ah, ok. Good to know. (I should probably know these things. :P )

darketaine’s picture

#27: Neither Classy nor Seven have CKEditor specific theming. It's about dialog's styling and unfortunately it's not just including the one that's created for Seven in Classy cause it has different theming.

I have to note here that even if we move on with classy too, if someone creates his own theming without classy as a base theme, it's inevitable to have different theming in Quick edit between links, images and ckeditor's modals (as it has different markup)

davidhernandez’s picture

What is the argument against putting this in the ckeditor module?

Wim Leers’s picture

Simple: the CKEditor module uses native Drupal dialogs for all of its plugins (link & image). Those dialogs are themed by the currently active Drupal theme.

The point of this issue is that CKEditor dialogs match Drupal dialogs. (CKEditor dialogs are used for e.g. the Table plugin, which doesn't make sense to reimplement in Drupal).

Which means that the styling of the CKEditor dialog must be per-theme, because the Drupal dialog is also styled per-theme.

davidhernandez’s picture

I see. So we need this styling in Classy...

and this in Seven...

darketaine’s picture

Yeap, exactly. The thing is that for the administration, where most people use Seven things are a bit easier, but for the quick edit part things can be trickier as it's depending on the current theme (in simple case, that's Classy).

davidhernandez’s picture

Classy is fine. That base styling is there, not in Stable or core. Themes not using Classy are on their own. That is the point of sensible defaults versus not. We have to draw a line somewhere.

ironkiat’s picture

Thanks to @bojhan, following up this in DrupalCon Asia...

Ported the Seven dialog style to bartik theme as the dialog in "quick edit" mode is still using classy.

Updated in Bartik:
2090937 dialog box in bartik quick edit

Would be great if anyone could do a review on this?

Status: Needs review » Needs work

The last submitted patch, 37: 2090937-37.patch, failed testing.

ironkiat’s picture

FileSize
41.21 KB

Current state in bartik:

current state in bartik

darketaine’s picture

I don't think the issue here is to change other themes' already styled dialogs, but make the ckeditor's core modals look like the drupal's. Maybe it would be better to create another issue if we think this is necessary for quick editor

ironkiat’s picture

Earlier patch failed, just updated patch file to pass testing.

Bojhan’s picture

@darketaine From WimLeers, David and a conversation with Lauri at DrupalconAsia - it is my understanding is that we do wish to change Bartik. We do not wish to adjust the standard look of CKeditor. This because the "raw" output of core, should not contain any opionated styling and just be purely functional.

Bojhan’s picture

Status: Needs work » Needs review
thpoul’s picture

@ironkiat can you please post the interdiff 35-41? It is always helpful to view the differences between patches and review them.

darketaine’s picture

@Bojhan But Bartik is just a theme. If you change it with a custom theme for example the dialogs will stay not-themed again. The issue is to make Ckeditor's dialogs look like Drupal's in Seven and -maybe- Classy which is a base theme. Of course none said core's theme should be changed. Classy is only under discussion cause it has a minimum styling in dialogs which is different from CKEditor's. Bartik and any other -even core- theme is not in this issue's scope :/
That's what I get at least from the description of the issue

Anyway let's see what Wim Leers and Cottser think about it :)

ironkiat’s picture

FileSize
71.5 KB

@thpoul It's the comment 39 (the current state ie. comment 35) and the 41 (in the updated bartik).

dialog compare 35 vs 41

thpoul’s picture

@ironkiat oops, I misspelled 25 to 35, sorry about that. I meant the interdiff of patch 2090937-25.patch and 2090937-42.patch. Take a look here.

ironkiat’s picture

FileSize
3.24 KB

Thanks @thpoul! I've uploaded the interdiff file here ;)

star-szr’s picture

Assigned: star-szr » Unassigned

I haven't read all the comments since I've been assigned but @Bojhan caught me up. I agree this should not go into Classy (or Stable for that matter) because Classy doesn't provide visual styling.

As for screenshots and manual testing I think we should also be covering when Bartik is used for content entry ("Use the administration theme when editing or creating content" unchecked on /admin/appearance).

darketaine’s picture

Classy has a minimum styling (the one with the white header) though. That was my argument. Anyway I thought the issue was about styling the ckeditor dialogs like Drupal's only, not even changing the existing Drupal's dialogs look like Seven's (that's what the last patch does) but I guess I got it wrong :)

darketaine’s picture

Btw #41 patch overrides completely all Bartik's dialogs even when "Use the administration theme when editing or creating content" is not checked to Seven's theming.

The fact that when you check the option Seven's theming doesn't appear instead of Bartik's in Quick Edit mode is another issue I think, not relevant to ckeditor's here. If that option worked like that it would take Seven's theme (which is changed for ckeditor from previous patches) and wouldn't need any more CSS. In that way any changes that would take place in Seven's dialogs for example would have immediate effect on Bartik's (and other theme's) quick edit too, not needing to duplicate CSS.

ironkiat’s picture

Yes it doesn't check whether is Administration theme being use to create content and it's meant to override it for all Bartik's dialog.
I'm not too sure right now what's the direction of this but I think it make sense that when "Use the Administration theme when creating content" is checked, it uses Seven's styling, or it is limited to just the content creation screens, which I could possibly make it more specific in the CSS.

darketaine’s picture

I would suggest to wait for Wim Leers who is the reporter and maintainer of the relative component.

davidhernandez’s picture

Classy provides the minimal styling in the first image I posted in #34. It is in the dialog.css.

Wim Leers’s picture

#37, #39: No, please don't do that here. That's a completely different issue. @darketaine is right in #40 & #51: this is just about CKEditor's native dialogs.

#42: Yes, we do want to change dialogs in Bartik to have sane styling. But that's a completely different issue. That's Drupal dialogs, not CKEditor dialogs. And doing that would belong in Bartik.


This is @darketaine's first core issue, and it's unfortunate that this issue has now been made extremely confusing. It's amazing that @darketaine hasn't already given up. Thanks for sticking with us, @darketaine!

So, +1 for #53.


For the problem being discussed/fixed in #37/#39/#42/…: it turns out that the current styling of Bartik's dialogs is as intended, according to #2226189: Style the modal in Bartik. However, given everybody seems to think it looks off, I think it's worth opening a follow-up to that issue. In that issue, only the absolute minimum was done. Let's go further.

darketaine’s picture

@WimLeers he he, it's not about giving up or getting confused but pushing things to the right -for the issue- direction.


For the other issue that came up I don't think it's even a Bartik's problem, but a decision about how we want the "Use the Administration theme when creating content" option to work in any theme. If that option checked has effect on Quick Editor too, then the work done here will have instant effect on any theme's ckeditor modals too. So the solution would be to just include the right CSS files in that case, not duplicating the relative CSS in any theme.

star-szr’s picture

Sorry if I contributed to the confusion!

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Wim Leers’s picture

Title: Style CKEditor dialog to match Drupal dialogs » Seven theme: style CKEditor-native dialogs to match Drupal-native dialogs

Attempt at improving title to make the actual issue scope more clear.

Wim Leers’s picture

Version: 8.2.x-dev » 8.1.x-dev
Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
FileSize
6.64 KB
100.62 KB
98.32 KB

The patch in #25 by @darketaine was the one that was within scope. It fully addresses the problem here. Reuploading it, without any changes.

Moving back to 8.1.x-dev, because there is zero risk here.

Compare:

Before
After
star-szr’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work
FileSize
11.36 KB
18.67 KB

Overall this looks very good! Before really reviewing the CSS I figured it would make sense to manually test and review the visual appearance.

I spotted a couple things that are a little bit off compared to the native dialogs and should be fixed:

The buttons are 18px high, should be 17px to be consistent with Seven's other buttons:

The typography of the dialog's title is a bit off, in the following screenshot the Drupal native dialog with the title renamed via inspector can be seen on the left. This affects the height as well:

kostyashupenko’s picture

Assigned: Unassigned » kostyashupenko
kostyashupenko’s picture

Status: Needs work » Needs review
FileSize
6.5 KB
6.33 KB
6.64 KB
1008 bytes

Fixed height of button, but not clear for me what should i do with typography? Could you describe the task in more detail and would be great to see another screens as well. Thanks

button before: before_154.png
button after: after_162.png

kostyashupenko’s picture

Assigned: kostyashupenko » Unassigned
darketaine’s picture

Assigned: Unassigned » darketaine

@kostyashupenko the problem is not on the padding (which -after #63 patch- causes the button to be smaller than Seven's), it's on the rendering of the font in both cases (title and button).

@Cottser I will fix it asap. Thanx for the -first phase of- review :)

darketaine’s picture

Status: Needs review » Needs work
darketaine’s picture

Assigned: darketaine » Unassigned
Status: Needs work » Needs review
FileSize
894 bytes
6.7 KB

And here it is. Changed font-size and line-height on both cases.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

Back to Cottser.

star-szr’s picture

Going to leave it at RTBC and review later but the CSS file should have a @file docblock or at least a docblock at the top. Forgot to mention that yesterday.

darketaine’s picture

Oh I'm sorry, I totally forgot that.

catch’s picture

Component: ckeditor.module » Seven theme
star-szr’s picture

Assigned: Unassigned » star-szr

Thanks :)

On my list to review.

star-szr’s picture

Assigned: star-szr » Unassigned
Status: Reviewed & tested by the community » Needs work

Sorry for the long turnaround on this review, I was sick for a while. I think once 1 (and maybe 2) below are addressed this is ready to go into 8.2.x and 8.1.x after beta2 is cut.

  1. I think .cke_dialog_contents needs:
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    
  2. I could go either way on this (it's a very slight difference so I would be fine committing without this change) but we could add a bit more precision to the font-size in at least one case:

    .cke_reset_all .cke_dialog_title could use a font-size of 1.3344em (one digit more precise than the 1.334em in #70) so that the computed font-size value matches that of .ui-dialog .ui-dialog-title.


The only other things I can think of are that we could disable the CKEditor moving functionality (where you can move the modal around by dragging the title bar) and just in general handle the positioning and such more like the core dialog (for example scroll the contents of the dialog when the viewport isn't tall enough to show it all), but:

  • I'm not sure we even want to do either of these things.
  • If we do decide we want to pursue either or both of these, we should do so in a separate issue after this is in.
himanshugautam’s picture

edited as per #73

himanshugautam’s picture

Status: Needs work » Needs review
star-szr’s picture

@himanshugautam interdiff please!

himanshugautam’s picture

FileSize
734 bytes
star-szr’s picture

Thanks @himanshugautam. I also just realized I haven't yet reviewed the code itself thoroughly, so I will still work on that :)

star-szr’s picture

Version: 8.1.x-dev » 8.2.x-dev

Since this is a user interface change, unfortunately I think it actually is too late for 8.1.x now that we are well into the beta phase per https://www.drupal.org/core/d8-allowed-changes#minor and the fact that this is an improvement, not a bug fix. Bumping to 8.2.x (where the patch still applies).

sarah_p’s picture

Sorry for dropping off, I got lost in the land of resetting up my local dev environment post computer wipe, thanks to everyone who pushed it through in a timely manner anyway. :)

star-szr’s picture

Assigned: Unassigned » star-szr

Putting on my list, don't want to forget about this one :)

yoroy’s picture

I love the attention to detail here :)

emma.maria’s picture

Status: Needs review » Needs work

Apologies for being picky but from looking through the code I've noticed some small CSS formatting standard nits...

  1. +++ b/core/themes/seven/css/theme/ckeditor-dialog.css
    @@ -0,0 +1,202 @@
    +  padding: .3em .4em .3em .5em;
    ...
    +  box-shadow: inset 0 1px 2px rgba(0,0,0,.125);
    ...
    +  box-shadow: inset 0 1px 3px rgba(0,0,0,.05),0 0 8px #40b6ff;
    

    A few decimal values within the CSS are missing leading zeros.

  2. +++ b/core/themes/seven/css/theme/ckeditor-dialog.css
    @@ -0,0 +1,202 @@
    +/**
    + * @file
    + * CKEditor-native dialogs theming.
    + */
    +.cke_dialog_background_cover {
    

    The file comment needs a blank line after it as per the Drupal CSS file comment standards...

    Note that a blank line should follow a file comment. And keep line-lengths to 80 columns, when possible. For more information, see the PHP file comment standards.

star-szr’s picture

Assigned: star-szr » Unassigned

Thanks @emma.maria appreciate it :)

thpoul’s picture

Here you go as per #83

@emma.maria I saw that core/themes/seven/css/components/form.css has the same issue with leading zeros. Look at textarea.form-textarea. Perhaps we should fix that in an other issue?

thpoul’s picture

Status: Needs work » Needs review

Switching to NR. Sorry for the noise.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

AFAICT RTBC again:

  1. +++ b/core/themes/seven/css/theme/ckeditor-dialog.css
    @@ -0,0 +1,203 @@
    +/**
    + * @file
    + * CKEditor-native dialogs theming.
    + */
    +
    +.cke_dialog_background_cover {
    

    Addresses #73.2/#83.2.

  2. +++ b/core/themes/seven/css/theme/ckeditor-dialog.css
    @@ -0,0 +1,203 @@
    +  opacity: 0.70;
    ...
    +  padding: 0.3em 0.4em 0.3em 0.5em;
    ...
    +  box-shadow: inset 0 1px 2px rgba(0,0,0,0.125);
    ...
    +  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05),0 0 8px #40b6ff;
    

    Addresses #83.1

  3. +++ b/core/themes/seven/css/theme/ckeditor-dialog.css
    @@ -0,0 +1,203 @@
    +.cke_dialog_contents {
    +  border-bottom-left-radius: 5px;
    +  border-bottom-right-radius: 5px;
    +}
    

    Addresses #73.1.

star-szr’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +RTL

Sorry for the review-in-many-parts, grabbing minutes when I can here and there.

The biggest thing I noticed with this review is after finally running this through http://csslint.net it pulled out an overly specific selector:

.cke_reset_all a.cke_dialog_close_button

It wanted this to be more like (remove the a element from the selector):

.cke_reset_all .cke_dialog_close_button

In doing so I noticed that CKEditor has LTR and RTL styles for the positioning of the close modal button (X). Nobody has tested RTL so far!

So I think we need to:

  1. Listen to CSSLint and make the selector less specific (remove a).
  2. Add an RTL style to position the X appropriately.

To test RTL with the table plugin, I:

  1. Installed the Language and Interface Translation modules
  2. Added the Arabic language
  3. Set Arabic as the default language

And some nits below.


  1. +++ b/core/themes/seven/css/theme/ckeditor-dialog.css
    @@ -0,0 +1,203 @@
    +  box-shadow: inset 0 1px 2px rgba(0,0,0,0.125);
    +  -webkit-transition: border linear 0.2s,box-shadow linear 0.2s;
    +  transition: border linear 0.2s,box-shadow linear 0.2s;
    ...
    +  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05),0 0 8px #40b6ff;
    ...
    +  background-image: -webkit-linear-gradient(top,#f6f6f3,#e7e7df);
    +  background-image: linear-gradient(to bottom,#f6f6f3,#e7e7df);
    ...
    +  text-shadow: 0 1px hsla(0,0%,100%,0.6);
    ...
    +  background-image: -webkit-linear-gradient(top,#fcfcfa,#e9e9dd);
    +  background-image: linear-gradient(to bottom,#fcfcfa,#e9e9dd);
    ...
    +  box-shadow: 0 1px 2px hsla(0,0%,0%,0.125)
    ...
    +  box-shadow: 0 0 0.5em 0.1em hsla(203,100%,60%,0.7);
    ...
    +  background-image: -webkit-linear-gradient(top,#f6f6f3,#e7e7df);
    +  background-image: linear-gradient(to bottom,#f6f6f3,#e7e7df);
    +  box-shadow: inset 0 1px 3px hsla(0,0%,0%,0.2);
    ...
    +  text-shadow: 0 1px hsla(0,0%,100%,0.6);
    ...
    +  background-image: -webkit-linear-gradient(top,#007bc6,#0071b8);
    +  background-image: linear-gradient(to bottom,#007bc6,#0071b8);
    ...
    +  text-shadow: 0 1px hsla(0,0%,0%,0.5);
    ...
    +  background-image: -webkit-linear-gradient(top,#0c97ed,#1f86c7);
    +  background-image: linear-gradient(to bottom,#0c97ed,#1f86c7);
    ...
    +  box-shadow: 0 1px 2px hsla(203,10%,10%,0.25);
    ...
    +  box-shadow: 0 0 0.5em 0.1em hsla(203,100%,60%,0.7);
    ...
    +  background-image: -webkit-linear-gradient(top,#08639b,#0071b8);
    +  background-image: linear-gradient(to bottom,#08639b,#0071b8);
    ...
    +  box-shadow: inset 0 1px 3px hsla(0,0%,0%,0.2);
    ...
    +  text-shadow: 0 1px hsla(0,0%,0%,0.5);
    

    While we're picking nits all of the commas on the lines I've selected need a space after them per https://www.drupal.org/node/1887862#properties.

  2. +++ b/core/themes/seven/css/theme/ckeditor-dialog.css
    @@ -0,0 +1,203 @@
    +  border: 1px solid #1280DF;
    

    This hex value should be lowercase per https://www.drupal.org/node/1887862#properties.

thpoul’s picture

Status: Needs work » Needs review
FileSize
23.84 KB
23.1 KB
22.6 KB
6.64 KB
7.55 KB
22.1 KB

Here is the updated patch updated as per #88. Nits were fixed and RTL support has been added.

A note on why .cke_rtl has been chosen instead of [dir="rtl"]:
If someone skips the installation of the Interface Translation module then CKEditor will not have RTL support (I was quite surprised to see this) and if [dir="rtl"] is applied the table dialog will look like this:

2090937-1

which is wrong since all the CKEditor dialogs should follow the same theming rules (check the image dialog for example and you will see that it has complete styling.

if .cke_rtl is used instead then we will have the following:

2090937-2.

After reconsidering the logic above, if a user does not activate the Interface Translation module the dialog will look like the following screenshot:

2090937-4.

Activating the Interface Translation module will result in the following which should be the expected one:

2090937-3.

I really wish to see this getting moved forward.

PS: Major credit of this should go to @darketaine who was the one pointing me the RTL css rules.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC, let's see if @Cottser has more feedback :)

star-szr’s picture

Assigned: Unassigned » star-szr

Thanks, will review again soon :)

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 89: 2090937-89.patch, failed testing.

emma.maria’s picture

Status: Needs work » Reviewed & tested by the community

The patch is green and still applies so I'm setting this back to RTBC *tiptoes away*

Wim Leers’s picture

*tiptoes away*

:D

star-szr’s picture

Assigned: star-szr » Unassigned
Status: Reviewed & tested by the community » Needs work

Thanks everyone. We are getting closer!

#73.1 (bottom corner radii) has not been fixed - there is a specificity issue because I think the CKEditor skin dialog.css is loaded after the ckeditor-dialog.css being added here.

I also tested on a high density screen and found that CKEditor has specific styles for high density displays (screenshot below), we'll need to add to our selector for the close icon and potentially others (refresh, lock, unlock - not sure if those would be used in our case). I think we need to take a good look at the CKEditor moono theme dialog.css to see what else we may need to account for.

CKEditor dialog with mismatched close icon

star-szr’s picture

FileSize
64.7 KB

Uploading the missing screenshot.

Wim Leers’s picture

Thanks for your extremely detailed reviews, @Cottser!

darketaine’s picture

Status: Needs work » Needs review
FileSize
8.41 KB
4.57 KB

After @Cottser's recommendations in #95 I checked out CKEditor moono theme dialog.css and apart from high density displays there were lots of overrides from high contrast displays selectors. Taking that into account here are some more specific selectors (that's a bit ugly :/ )

Hope this is in the right direction :)

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

Back to @Cottser!

star-szr’s picture

Assigned: Unassigned » star-szr

Thanks, will review as soon as I can!

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 98: 2090937-98.patch, failed testing.

thpoul’s picture

Status: Needs work » Reviewed & tested by the community
star-szr’s picture

Other things have been getting in the way but this is at the top of my list to review :)

star-szr’s picture

Assigned: star-szr » Unassigned
Status: Reviewed & tested by the community » Needs review

This looks great, I ran through a bunch of tests again and can't find any faults with the code or visuals.

My only other thought at this time is whether we should be doing some grouping (and possible commenting) of the CSS rules per "Blank lines" in https://www.drupal.org/node/1887862#whitespace. It's relatively minor but since we're adding a new ~250 line CSS file I thought I would bring it up.

darketaine’s picture

I 'll give this a try.
I hope comments are in the right direction, I tried to not overdo it.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

  • Cottser committed 21c135f on 8.2.x
    Issue #2090937 by darketaine, thpoul, Wim Leers, ironkiat,...
star-szr’s picture

Status: Reviewed & tested by the community » Fixed

Thanks to everyone who worked on this especially @darketaine for sticking with us :) so happy to be committing this.

Committed 21c135f and pushed to 8.2.x. Thanks! :D

Wim Leers’s picture

WOOOOOOOOT!

Go go go @darketaine!

webchick’s picture

Issue tags: +8.2.0 release notes

Great work!

This has traditionally been a big enough annoyance that it might be worth explicitly calling out in the release notes.

Bojhan’s picture

  • CKEditors dialogs are not ugly anymore.

  • Cottser committed 21c135f on 8.3.x
    Issue #2090937 by darketaine, thpoul, Wim Leers, ironkiat,...

  • Cottser committed 21c135f on 8.3.x
    Issue #2090937 by darketaine, thpoul, Wim Leers, ironkiat,...
Wim Leers’s picture

@Bojhan: nice release note suggestion :P

@webchick @Bojhan In all seriousness, I doubt this merits a release note mention. This only affects native CKEditor dialogs, not the link/image dialogs that Drupal's CKEditor integration uses, because those dialogs are Drupal dialogs, not CKEditor dialogs.

Status: Fixed » Closed (fixed)

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

Rajab Natshah’s picture

Thanks a lot .. was waiting for this for so long.
We need to find a way to let other admin themes use this library.

I will try adding this in some other admin themes.

 libraries-extend:
  core/ckeditor:
    - seven/ckeditor-dialog

And this :

ckeditor-dialog:
  version: VERSION
  css:
    theme:
      css/theme/ckeditor-dialog.css: {}

Rewarded work :)

Wim Leers’s picture

This introduced a small regression: #2820200: Display resize icon for CKEditor on Seven theme. Please review the proposed patch there (which is super simple: it deletes 3 lines from a CSS file!).

Wim Leers’s picture

Component: ckeditor.module » Seven theme