From 33ef89297b2b7a6cd0e867068b0b4d0f1a3420f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Tue, 31 Jul 2018 21:57:20 -0400 Subject: [PATCH] Include Agaric styleguide CSS in global library Taken from Rosemary and Nedjo's work in https://gitlab.com/uc-davis/patient-hm-brain/blob/master/web/themes/custom/henry/henry.theme 07981c439dfbf390abe047a7a95b053ffe4522cb --- web/themes/custom/agarica/agarica.theme | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/web/themes/custom/agarica/agarica.theme b/web/themes/custom/agarica/agarica.theme index 3893a4c..9d51bba 100644 --- a/web/themes/custom/agarica/agarica.theme +++ b/web/themes/custom/agarica/agarica.theme @@ -2,6 +2,25 @@ // 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.