Skip to content
Snippets Groups Projects
Commit b383ab9e authored by Rajab Natshah's avatar Rajab Natshah
Browse files

Issue #3349570: Fix Gin layer wrapper style for Dashboards with style overrides method

parent 6323c575
No related branches found
No related tags found
No related merge requests found
......@@ -75,3 +75,24 @@
html.dashboard .toolbar .toolbar-bar .home-toolbar-tab {
display: block;
}
.gin-layer-wrapper .gin-layer-wrapper {
padding: 0;
border: 0;
box-shadow: none;
}
.gin-layer-wrapper .gin-layer-wrapper .gin-table-scroll-wrapper {
padding-bottom: 0;
margin-bottom: 0;
}
.gin-layer-wrapper .panel__content,
.gin-layer-wrapper .panel__description {
padding: var(--gin-spacing-m);
}
.gin-layer-wrapper .panel__content .status-report-card,
.gin-layer-wrapper .panel__description .status-report-card {
text-align: center;
}
......@@ -155,17 +155,23 @@ function dashboards_form_dashboard_form_alter(&$form, FormStateInterface $form_s
* Implements hook_preprocess_block().
*/
function dashboards_preprocess_block(&$variables) {
if (
isset($variables['attributes']) &&
isset($variables['attributes']['class']) &&
in_array('dashboard-gin-panel', $variables['attributes']['class'])
) {
$variables['title_attributes'] = ['class' => ['panel__title']];
$variables['content'] = [
'#type' => 'container',
'#attributes' => ['class' => ['panel__content']],
'content' => $variables['content'],
];
$active_theme = \Drupal::theme()->getActiveTheme();
$base_themes = (array) $active_theme->getBaseThemeExtensions();
if ($active_theme->getName() === 'gin'|| array_key_exists('gin', $base_themes)) {
if (
isset($variables['attributes']) &&
isset($variables['attributes']['class']) &&
in_array('dashboard-gin-panel', $variables['attributes']['class'])
) {
$variables['title_attributes'] = ['class' => ['panel__title']];
$variables['content'] = [
'#type' => 'container',
'#attributes' => ['class' => ['panel__content']],
'content' => $variables['content'],
];
$variables['attributes']['class'][] = 'gin-layer-wrapper';
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment