Commit ada3f8f0 authored by opdavies's avatar opdavies

Only override the logo if the base theme is being used

parent 08be5192
......@@ -9,10 +9,21 @@
* Implements hook_preprocess_HOOK().
*/
function tailwindcss_preprocess_block(&$variables) {
if ($variables['base_plugin_id'] == 'system_branding_block') {
if (tailwindcss_get_active_theme() == 'tailwindcss' && $variables['base_plugin_id'] == 'system_branding_block') {
$variables['site_logo'] = '';
if ($variables['content']['site_logo']['#access'] && $variables['content']['site_logo']['#uri']) {
$variables['site_logo'] = str_replace('.svg', '.png', $variables['content']['site_logo']['#uri']);
}
}
}
/**
* Get the active theme.
*
* @return string
* The name of the active theme.
*/
function tailwindcss_get_active_theme() {
return \Drupal::service('theme.manager')->getActiveTheme()->getName();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment