diff --git a/core/modules/layout_builder/css/layout-builder.css b/core/modules/layout_builder/css/layout-builder.css index 2f07a95..0b61756 100644 --- a/core/modules/layout_builder/css/layout-builder.css +++ b/core/modules/layout_builder/css/layout-builder.css @@ -86,7 +86,7 @@ padding-top: 0.55em; } -#drupal-off-canvas a.inline-block-create-button { +#drupal-off-canvas .choose-block-container .inline-block-create-button { display: block; padding: 24px; padding-left: 44px; @@ -95,15 +95,14 @@ background: url(../../../misc/icons/bebebe/plus.svg) transparent 16px no-repeat; } -#drupal-off-canvas a.inline-block-create-button, -#drupal-off-canvas .inline-block-list a { +#drupal-off-canvas .choose-block-container .inline-block-create-button, +#drupal-off-canvas .inline-block-list .inline-block-list__item { margin: 0 -20px; - transition: background-color 0.5s; background-color: #444; } -#drupal-off-canvas a.inline-block-create-button:hover, -#drupal-off-canvas .inline-block-list a:hover { +#drupal-off-canvas .choose-block-container .inline-block-create-button:hover, +#drupal-off-canvas .inline-block-list .inline-block-list__item:hover { background-color: #333; } @@ -111,7 +110,7 @@ margin-bottom: 15px; } -#drupal-off-canvas .inline-block-list a { +#drupal-off-canvas .inline-block-list .inline-block-list__item { display: block; padding: 15px 0 15px 25px; } diff --git a/core/modules/layout_builder/src/Controller/ChooseBlockController.php b/core/modules/layout_builder/src/Controller/ChooseBlockController.php index 6c94732..7e6c1ba 100644 --- a/core/modules/layout_builder/src/Controller/ChooseBlockController.php +++ b/core/modules/layout_builder/src/Controller/ChooseBlockController.php @@ -75,6 +75,9 @@ public static function create(ContainerInterface $container) { */ public function build(SectionStorageInterface $section_storage, $delta, $region) { $build['#title'] = $this->t('Choose a block'); + $build['#type'] = 'container'; + $build['#attributes']['class'][] = 'choose-block-container'; + if ($this->entityTypeManager->hasDefinition('block_content_type') && $types = $this->entityTypeManager->getStorage('block_content_type')->loadMultiple()) { if (count($types) === 1) { $type = reset($types); @@ -203,6 +206,7 @@ protected function getBlockLinks(SectionStorageInterface $section_storage, $delt ), 'attributes' => $this->getAjaxAttributes(), ]; + $link['attributes']['class'][] = 'inline-block-list__item'; $links[] = $link; }