Remove dialog libraries

Created on 11 November 2020, over 3 years ago
Updated 22 March 2023, over 1 year ago

Problem/Motivation

Gin/claro dialog libraries are used on any page which displays the toolbar. This leads to different UX for users that can use the toolbar and those who can't. I don't see a reason why the gin_toolbar should add gin/claro dialog libraries.

Steps to reproduce

  • Install gin_toolbar
  • Login as user seeing the toolbar => gin/claro styling is used
  • Login as user not seeing the toolbar => gin/claro styling is not used

Proposed resolution

gin_toolbar should not interfere with non-toolbar styles, so this should be removed: https://git.drupalcode.org/project/gin_toolbar/-/blob/8.x-1.x/gin_toolba...

    // Add library for dialog.
    $page['#attached']['library'][] = 'gin/gin_dialog';
    $page['#attached']['library'][] = 'claro/claro.drupal.dialog';

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany anruether Bonn

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡«πŸ‡·France ericdsd France

    Hi i tried to apply that same solution again on 8.x-1.0-rc1 and core 9.5.3, and it turns out that :

    • if i clear the caches with drush > my modal its correctly styles in front theme
    • if i clear the caches from ui (link in gin_toolbar on a frontend page > my modal gets overridden by gin (black header and transparent background)
  • πŸ‡«πŸ‡·France ericdsd France

    A quick fix was to use

    /**
     * Implements hook_css_alter().
     */
    function MY_FRONTEND_THEME_css_alter(&$css, $assets) {
      $path = \Drupal::service('extension.list.theme')->getPath('gin') . '/dist/css/components/dialog.css';
      unset($css[$path]);
    }
    
  • πŸ‡ΊπŸ‡ΈUnited States bvoynick

    Also ran in to this. Gin defines two separate libraries for dialogs, so you'll need three overrides:

    libraries-override:
      claro/claro.drupal.dialog: false
      gin/dialog: false
      gin/gin_dialog: false

    With the addition of gin/dialog to the list, I'm no longer seeing any Gin dialog-related CSS in the public theme using these overrides.

Production build 0.69.0 2024