- Issue created by @Rajab Natshah
- @rajab-natshah opened merge request.
- @rajab-natshah opened merge request.
- 🇯🇴Jordan Rajab Natshah Jordan
This is a quick fix for the issue
Having the following logic would be better for sure as Sascha → helped with a module in Issue #3276164 → by saschaeggi → : Added style overrides for The Gin admin theme.
Which had to support Gin, Claro and their sub themes with the same code base.
$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'; }
- 🇯🇴Jordan Rajab Natshah Jordan
It is for the
2.1.x
branchTesting with Support for Claro and Gin
$active_theme = \Drupal::theme()->getActiveTheme(); $base_themes = (array) $active_theme->getBaseThemeExtensions(); if ($active_theme->getName() === 'gin'|| array_key_exists('gin', $base_themes)) { $build['#attributes']['class'][] = 'dashboard-gin-panel'; $build['#attributes']['class'][] = 'gin-layer-wrapper'; } elseif ($active_theme->getName() === 'claro' || array_key_exists('claro', $base_themes)) { $build['#attributes']['class'][] = 'dashboard-claro-panel'; $build['#attributes']['class'][] = 'card'; }
- Issue was unassigned.
- Status changed to Needs review
almost 2 years ago 1:07pm 22 March 2023 - 🇯🇴Jordan Rajab Natshah Jordan
This is a quick basic fix have the Dashboards with Layout Builder works with Gin or Claro.
I would love to separate the logic and libraries, not to havedashboard-gin-panel
for all admin themes. - 🇯🇴Jordan Rajab Natshah Jordan
Thank you, Erik for this so nice and important module!
- 🇩🇪Germany Erik Seifert
Thank you for support and work on this module. And after your patch is looking very nice. I like it ;-) Seems your MR does not have any changes, so i commit the patch.
-
Erik Seifert →
committed 82ea9a92 on 2.1.x authored by
Rajab Natshah →
Issue #3349570 by Rajab Natshah: Fix Gin layer wrapper style for...
-
Erik Seifert →
committed 82ea9a92 on 2.1.x authored by
Rajab Natshah →
- Status changed to Fixed
over 1 year ago 10:48am 23 March 2023 Automatically closed - issue fixed for 2 weeks with no activity.