- Issue created by @lauriii
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
AFAICT this is because some of Olivero's styles (aka the
defaulttheme akasystem.theme:defaultin the screenshot) are not injected into the component'scssand/orheader_js, for itsdefault_markup.IOW:
\Drupal\experience_builder\Plugin\ExperienceBuilder\ComponentSource\BlockComponent::getClientSideInfo()would need to changereturn ['build' => $this->renderComponent([], $component->uuid())];to something like
$build = $this->renderComponent([], $component->uuid()); // Attach the default theme's … $build['#attached']['library'][] = … return ['build' => $build];Although arguably, this is a bug in
\Drupal\system\Plugin\Block\SystemBrandingBlock::build()… but as far as that implementation is concerned, XB's rendering-in-isolation of this block is an unexpected use case.But I think I see a possible heuristic for this:
$build = $this->renderComponent([], $component->uuid()); if (!empty(array_intersect($build['#cache']['tags'], ['config:system.site', 'config:system.theme'])) { // Attach the default theme's … $build['#attached']['library'][] = … } return ['build' => $build];Something like that?
- 🇬🇧United Kingdom thoward216
Had a look into this issue and got the library attached using similar code as shown in #2 but the preview still did not appear to update as expected. Requires further investigation.
- 🇫🇮Finland lauriii Finland
Since this only impacts the preview before adding components to a page, it doesn't seem this would have to block a stable release. We may still want to look into this since there might be other ways in which the preview is inaccurate.