diff --git a/src/Plugin/BootstrapStyles/Style/BackgroundColor.php b/src/Plugin/BootstrapStyles/Style/BackgroundColor.php index d0a1152..5c67296 100644 --- a/src/Plugin/BootstrapStyles/Style/BackgroundColor.php +++ b/src/Plugin/BootstrapStyles/Style/BackgroundColor.php @@ -122,7 +122,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'; + } // Responsive. $fields = [ diff --git a/src/Plugin/BootstrapStyles/Style/BackgroundMedia.php b/src/Plugin/BootstrapStyles/Style/BackgroundMedia.php index d12a007..e0ac58f 100644 --- a/src/Plugin/BootstrapStyles/Style/BackgroundMedia.php +++ b/src/Plugin/BootstrapStyles/Style/BackgroundMedia.php @@ -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'; } } }