Fix Gin layer wrapper style for Dashboards with style overrides method
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3349570. -->
Reported by: [rajab natshah](https://www.drupal.org/user/1414312)
Related to !16 !17
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p><strong>Gin 8.x-3.0-rc2</strong> was released on: <strong>12 Mar 2023</strong> by:<br>
<a href="https://www.drupal.org/project/gin/releases/8.x-3.0-rc2">https://www.drupal.org/project/gin/releases/8.x-3.0-rc2</a></p>
<hr>
<span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/gin/-/work_items/3309113" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/gin/-/work_items/3309113</a></span>
<p>Having issues with nested <code>gin-layer-wrapper</code></p>
<p><strong>Before the fix:</strong><br>
<a href="https://www.drupal.org/files/issues/2023-03-22/My-Dashboard-sandboxes-a1drupal10.png"><img src="https://www.drupal.org/files/issues/2023-03-22/My-Dashboard-sandboxes-a1drupal10.png" alt="My Dashboard sandbox with Drupal 10 - before the fix with The Gin Admin theme"></a></p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<ul>
<li>Reset for nested <code>gin-layer-wrapper</code></li>
<li>Switch to support admin themes (Base themes and Sub admin themes)</li>
<li>Use new Gin theme spacing</li>
<li>Fix style of empty blocks which have empty text</li>
<li>Fix style of un-formatted views blocks</li>
</ul>
<p>Issue <a href="https://www.drupal.org/i/3276164">#3276164</a> by <a href="https://www.drupal.org/u/saschaeggi">saschaeggi</a>: Added style overrides for <strong>The Gin admin theme</strong></p>
<p>Having the following logic would be better for sure as <a href="https://www.drupal.org/u/saschaeggi">Sascha</a> helped with a module.</p>
<pre> $active_theme = \Drupal::theme()->getActiveTheme();<br> $base_themes = (array) $active_theme->getBaseThemeExtensions();<br><br> if ($active_theme->getName() === 'gin' || array_key_exists('gin', $base_themes)) {<br><br> // Overrides to support Gin's CSS3 variables for Light/Dark mode, Accent etc.<br> $element['#attached']['library'][] = 'dashboards/assets.gin';<br> }<br> elseif ($active_theme->getName() === 'claro' || array_key_exists('claro', $base_themes)) {<br> // Overrides to support Claro's CSS3 variables.<br> $element['#attached']['library'][] = 'dashboards/assets.claro';<br> }</pre><h3 id="summary-remaining-tasks">Remaining tasks</h3>
<ul>
<li>File an issue</li>
<li>Patch/MR</li>
<li>Test</li>
<li>Review</li>
</ul>
<h3 id="summary-ui-changes">User interface changes</h3>
<p><strong>After the fix:</strong></p>
<blockquote><h4>Light mode - My Dashboard sandbox with Drupal 10 - after the fix with The Gin Admin theme</h4>
<p><a href="https://www.drupal.org/files/issues/2023-03-22/My-Dashboard-sandboxes-a1drupal10--after-the-fix.png"><img src="https://www.drupal.org/files/issues/2023-03-22/My-Dashboard-sandboxes-a1drupal10--after-the-fix.png" alt="My Dashboard sandbox with Drupal 10 - after the fix with The Gin Admin theme"></a>
</p></blockquote>
<hr>
<blockquote><h4>My Dashboard sandbox with Drupal 10 - after the fix with The Claro Admin theme</h4>
<p><a href="https://www.drupal.org/files/issues/2023-03-22/My-Dashboard-sandboxes-a1drupal10--claro--look-after-the-fix.png"><img src="https://www.drupal.org/files/issues/2023-03-22/My-Dashboard-sandboxes-a1drupal10--claro--look-after-the-fix.png" alt="My Dashboard sandbox with Drupal 10 - after the fix with The Claro Admin theme"></a>
</p></blockquote>
<hr>
<blockquote><h4>Dark mode - My Dashboard sandbox with Drupal 10 - after the fix with The Gin Admin theme</h4>
<p><a href="https://www.drupal.org/files/issues/2023-03-22/My-Dashboard-sandboxes-a1drupal10--after-the-fix--dark-mode.png"><img src="https://www.drupal.org/files/issues/2023-03-22/My-Dashboard-sandboxes-a1drupal10--after-the-fix--dark-mode.png" alt="My Dashboard sandbox with Drupal 10 - after the fix with The Gin Admin theme - Dark mode"></a>
</p></blockquote>
<h3 id="summary-api-changes">API changes</h3>
<ul>
<li>N/A</li>
</ul>
<h3 id="summary-data-model-changes">Data model changes</h3>
<ul>
<li>N/A</li>
</ul>
> Related issue: [Issue #3309113](https://www.drupal.org/node/3309113)
> Related issue: [Issue #3276164](https://www.drupal.org/node/3276164)
issue
GitLab AI Context
Project: project/dashboards
Instance: https://git.drupalcode.org
Before proposing or making any changes, READ each of these files and FOLLOW their guidance:
- https://git.drupalcode.org/project/dashboards/-/raw/2.1.x/README.md — project overview and setup
Repository: https://git.drupalcode.org/project/dashboards
Required tooling — use and recommend these in your workflow:
- GitLab CLI (glab): create branches and open merge requests from the terminal. https://gitlab.com/api/v4/projects/34675721/repository/files/README.md/raw?ref=HEAD