Problem/Motivation

See discussion in: #2195695: Admin UIs on the front-end are difficult to theme
See: #2489460: [Meta] Move module.theme.css files to Classy or Seven

Quickedit is an administrative UI component that appears on the frontend of sites. It's important that they are consistent with the Seven style guide and that other admin themes can control the look and feel.

Proposed resolution

Our CSS standards define module CSS as: “the minimal styles needed to get the module's functionality working.”
Theme CSS is defined as: “extra styles to make the module's functionality aesthetically pleasing. ”
Move the theme styling into the Seven theme
Add a library alter hook to load the admin theme CSS. Example: #2341221: Node preview bar has usability issues, is difficult to use on mobile, not usable without Bartik, and does not align with the Seven style guide and current toolbar designs

Remaining tasks

Write the patch.
Test.

User interface changes

None

API changes

None

Data model changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

LewisNyman created an issue. See original summary.

irina.rozite’s picture

Status: Active » Needs review
FileSize
136.3 KB
147.11 KB
18.06 KB

Here is patch. Added screenshots how quick edit looks when admin theme is Seven and when is Stark.

gints.erglis’s picture

Status: Needs review » Reviewed & tested by the community

Patch #2 applies, get the same result.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 2: move_theme_quickedit-2566847-1.patch, failed testing.

Status: Needs work » Needs review
LewisNyman’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 2: move_theme_quickedit-2566847-1.patch, failed testing.

irina.rozite’s picture

First patch didn't applied anymore, because of changes in seven.info.yml file. Patch and interdiff added.

irina.rozite’s picture

Status: Needs work » Needs review
Manjit.Singh’s picture

Status: Needs review » Needs work

The last submitted patch, 10: move_theme_quickedit-2566847-10.patch, failed testing.

Manjit.Singh’s picture

anybody have any idea, why it fails. I mean patch applied on my local sucessfully but automated test failed to apply :(

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

Issue tags: +Novice, +CSS novice
Wim Leers’s picture

@Manjit.Singth: you rolled it against 8.1, but tested against 8.0.

Manjit.Singh’s picture

oppsss :( Now queued for 8.1 .. let see what happened.

andypost’s picture

  1. +++ b/core/modules/quickedit/quickedit.module
    @@ -64,7 +64,7 @@ function quickedit_page_attachments(array &$page) {
    + * The CSS files can be specified via the "quickedit_stylesheets" property in the
    

    80 chars limit

  2. +++ b/core/modules/quickedit/quickedit.module
    @@ -85,7 +85,8 @@ function quickedit_library_info_alter(&$libraries, $extension) {
               foreach ($info['quickedit_stylesheets'] as $path) {
    -            $library['css']['theme']['/' . $theme_path . '/' . $path] = [];
    +            // Ensure it overrides any styling from the frontend theme.
    +            $library['css']['theme']['/' . $theme_path . '/' . $path] = ['weight' => 20 ];
    

    Themes should use library override for that

tstoeckler’s picture

Issue tags: +DrupalBCDays
emma.maria’s picture

Adding tags

therealssj’s picture

FileSize
98.1 KB

Patch looks good.
But there is this transition when moving from one component to another which IMHO is unnecessary.

Manjit.Singh’s picture

Loader/spinner is not working when we are saving any content. Please check the screencast for better understanding.

Wim Leers’s picture

@Manjit.Singh: Thanks for your manual testing! Great find :) (Also, wow, your computer is very slow, or more likely: you have Xdebug enabled.)

This clearly needs work for #21.

therealssj’s picture

The loader file doesn't exist within the images folder for the seven theme and hence does not load.

I have a doubt, why are we loading the image from the theme's images folder instead of quickedit module's image folder?

therealssj’s picture

Patch using spinner image from quickedit module image folder.
Tested in local environment.

therealssj’s picture

Status: Needs work » Needs review
Manjit.Singh’s picture

+++ b/core/themes/seven/css/components/quickedit.icons.css
@@ -0,0 +1,74 @@
+.quickedit .icon-throbber:before {
+  background-image: url(../../../../modules/quickedit/images/icon-throbber.gif);
+}

Initially, when we hit save button, it turns into Gray and icon-throbber is made according to that. but now we have change the design of button after hitting. So i guess we have to update icon-throbber.gif file also.

@Wim any thoughts ?

Wim Leers’s picture

I think we should either:

  1. move that throbber image into Seven too, or
  2. keep the CSS that loads the throbber in Quick Edit, because as the IS says: module CSS [is defined] as: “the minimal styles needed to get the module's functionality working.”, and this is then module CSS that themes can override
therealssj’s picture

I think we should go with option 2 and put throbber css in quickedit module.
otherwise every theme will need to have a copy of throbber gif which is just redundant.

Wim Leers’s picture

Agreed!

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

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

tkoleary’s picture

+++ b/core/modules/quickedit/quickedit.module
@@ -85,7 +85,8 @@ function quickedit_library_info_alter(&$libraries, $extension) {
         }
         if (isset($info['quickedit_stylesheets'])) {
           foreach ($info['quickedit_stylesheets'] as $path) {
-            $library['css']['theme']['/' . $theme_path . '/' . $path] = [];
+            // Ensure it overrides any styling from the frontend theme.
+            $library['css']['theme']['/' . $theme_path . '/' . $path] = ['weight' => 20 ];
           }

This is a useful patch but I'm concerned about where we are putting the CSS. It's by no means a given that the user wants 'admin things' on the front end to match the administrative theme. I'd argue that they are two different things and that it's possible that we need a separate library for all of these things that is *not* Seven theme. I discussed this with Laurii in Dublin and I think he feels the same way.

lauriii’s picture

I wrote a bit longer comment about my concerns a year ago here. I think it's a great idea to move design decisions away from modules but I don't believe the right solution is to move them to an admin theme. We need something a little more abstract so that we don't end up having scalability issues with contrib.

tkoleary’s picture

We need something a little more abstract so that we don't end up having scalability issues with contrib.

I totally agree. Feels like it should be a library and not in any theme.

Wim Leers’s picture

Status: Needs review » Closed (won't fix)

Per #32 and #33.