Skip to content
Snippets Groups Projects
Commit e6f0b937 authored by Noor Ghunaim's avatar Noor Ghunaim Committed by Rajab Natshah
Browse files

Issue #3213112 by n.ghunaim: Add a specific class when having sections with...

Issue #3213112 by n.ghunaim: Add a specific class when having sections with background color, image, or video option
parent 60219f68
No related branches found
No related tags found
No related merge requests found
......@@ -98,7 +98,11 @@ class BackgroundColor extends StylePluginBase {
$background_type = $storage['background']['background_type'] ?? 'color';
if ($background_type != 'video') {
$classes[] = $storage['background_color']['class'];
$classes[] = $storage['background_color']['class'] !== "_none" ? $storage['background_color']['class'] : "";
if (!empty($storage['background_color']['class']) && $storage['background_color']['class'] !== "_none") {
$classes[] = 'bg-color';
}
// Add the classes to the build.
$build = $this->addClassesToBuild($build, $classes, $theme_wrapper);
......
......@@ -390,9 +390,11 @@ class BackgroundMedia extends StylePluginBase implements ContainerFactoryPluginI
// Assign the style to element or its theme wrapper if exist.
if ($theme_wrapper && isset($build['#theme_wrappers'][$theme_wrapper])) {
$build['#theme_wrappers'][$theme_wrapper]['#attributes']['style'][] = $background_image_style;
$build['#theme_wrappers'][$theme_wrapper]['#attributes']['class'][] = 'bg-image';
}
else {
$build['#attributes']['style'][] = $background_image_style;
$build['#attributes']['class'][] = 'bg-image';
}
}
}
......
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