agaric-coop/web/themes/custom/agarica/agarica.theme

38 lines
1.2 KiB
Text
Raw Normal View History

<?php
// TODO: Make this file unnecessary because we will not allow deploying code to the platform
/**
* @file
* Theme functions.
*/
/**
* Implements hook_library_info_alter().
*/
function agarica_library_info_alter(&$libraries, $extension) {
if ($extension === 'bulma' && isset($libraries['global'])) {
// Since the replaced library files are no longer located in a directory
// relative to the original extension, specify an absolute path (relative
// to DRUPAL_ROOT / base_path()) to the new location.
$css_file = '/' . drupal_get_path('theme', 'agarica') . '/styleguide/assets/css/agaric.css';
$libraries['global']['css']['base'] = [
$css_file => [],
];
}
}
/**
* Implements hook_theme_suggestions_HOOK_alter for blocks.
*
* See "Inheriting Block Templates" in
* https://www.drupal.org/docs/8/theming-drupal-8/creating-a-drupal-8-sub-theme-or-sub-theme-of-sub-theme
*/
function family_home_theme_suggestions_block_alter(&$suggestions, $variables) {
// Load theme suggestions for blocks from parent theme.
foreach ($suggestions as &$suggestion) {
$suggestion = str_replace('family_home_', 'octavia_', $suggestion);
}
}