Fix Gin layer wrapper style for Dashboards with style overrides method

Created on 22 March 2023, almost 2 years ago
Updated 23 March 2023, over 1 year ago

Problem/Motivation

Gin 8.x-3.0-rc2 was released on: 12 Mar 2023 by:
https://www.drupal.org/project/gin/releases/8.x-3.0-rc2

📌 Change CSS3 variables from camelCase to kebab-case Fixed

Having issues with nested gin-layer-wrapper

Before the fix:

Proposed resolution

  • Reset for nested gin-layer-wrapper
  • Switch to support admin themes (Base themes and Sub admin themes)
  • Use new Gin theme spacing
  • Fix style of empty blocks which have empty text
  • Fix style of un-formatted views blocks

Issue #3276164 by saschaeggi : Added style overrides for The Gin admin theme

Having the following logic would be better for sure as Sascha helped with a module.


      $active_theme = \Drupal::theme()->getActiveTheme();
      $base_themes = (array) $active_theme->getBaseThemeExtensions();

      if ($active_theme->getName() === 'gin' || array_key_exists('gin', $base_themes)) {

        // Overrides to support Gin's CSS3 variables for Light/Dark mode, Accent etc.
        $element['#attached']['library'][] = 'dashboards/assets.gin';
      }
      elseif ($active_theme->getName() === 'claro' || array_key_exists('claro', $base_themes)) {
        // Overrides to support Claro's CSS3 variables.
        $element['#attached']['library'][] = 'dashboards/assets.claro';
      }

Remaining tasks

  • File an issue
  • Patch/MR
  • Test
  • Review

User interface changes

After the fix:

Light mode - My Dashboard sandbox with Drupal 10 - after the fix with The Gin Admin theme

My Dashboard sandbox with Drupal 10 - after the fix with The Claro Admin theme

Dark mode - My Dashboard sandbox with Drupal 10 - after the fix with The Gin Admin theme

API changes

  • N/A

Data model changes

  • N/A
🐛 Bug report
Status

Fixed

Version

2.1

Component

Code

Created by

🇯🇴Jordan Rajab Natshah Jordan

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

Comments & Activities

Production build 0.71.5 2024