- Issue created by @_shy
We want to change some styles for the LB block forms, and probably this will cause huge changes.
I found that in the \Drupal\bootstrap_styles\Form\SettingsForm::buildForm()
hardcoded options for the theme selector.
// Layout builder theme toggler.
$options = [
'dark' => $this->t('Dark'),
'light' => $this->t('Light'),
];
After that, according to the values from this form, it will attach a library for different themes in the bootstrap_styles_page_attachments_alter()
// Attach the libraries only in the layout route.
if (in_array($route_match->getRouteName(), $layout_routes)) {
// Attach the layout builder form styles.
$page['#attached']['library'][] = 'bootstrap_styles/layout_builder_form_style';
if ($settings->get('layout_builder_theme') && $settings->get('layout_builder_theme') == 'light') {
$page['#attached']['library'][] = 'bootstrap_styles/theme.light';
}
else {
// Attach the default dark theme.
$page['#attached']['library'][] = 'bootstrap_styles/theme.dark';
}
}
We want to create a separate custom theme based on the styles for the dark theme but change some things. Do we just need to add the option to the form and then attach the library with styles if this setting is selected?
Or does it require some more effort which I missed?
Active
1.0
Code