From 0307f5ac1a0bf1943fbbaee04ecfcf5155517fb8 Mon Sep 17 00:00:00 2001 From: Morgan Dawe Date: Tue, 2 Jul 2024 16:32:34 -0300 Subject: [PATCH 1/4] Create bcelndora.module Adding .module and required theme asset override hooks. --- bcelndora.module | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 bcelndora.module diff --git a/bcelndora.module b/bcelndora.module new file mode 100644 index 0000000..d702eaa --- /dev/null +++ b/bcelndora.module @@ -0,0 +1,36 @@ + +/** + * @file + * bcelndora.module + */ + +/** + * Implements hook_scss_compiler_import_paths_alter(). + */ +function bcelndora_scss_compiler_import_paths_alter(array &$additional_import_paths) { + $theme_path = \Drupal::service('extension.list.theme')->getPath('dgi_i8_base'); + $additional_import_paths[] = \Drupal::service('file_system')->realpath($theme_path) . "/scss/"; +} + +/** + * Implements hook_page_attachments(). + * + * Attach BCELN specific base theme overrides via the module library. + */ +function bcelndora_page_attachments(array &$page) { + if (\Drupal::theme()->getActiveTheme()->getName() === "dgi_i8_base") { + $page['#attached']['library'][] = 'bcelndora/theme_overrides'; + } +} + +/** + * Implements hook_library_info_alter(). + * + * Unset the theme's 'framework' library CSS, as this module provides its own + * via this module's 'hook_page_attachments' implementation. + */ +function bcelndora_library_info_alter(&$libraries, $extension) { + if ($extension == 'dgi_i8_base' && isset($libraries['framework']['css']['theme']['scss/style.scss'])) { + unset($libraries['framework']['css']['theme']['scss/style.scss']); + } +} From 3e56cf3f8f07e6913c27c9f4c55b0d6e93e2e2e2 Mon Sep 17 00:00:00 2001 From: Morgan Dawe Date: Tue, 2 Jul 2024 16:33:48 -0300 Subject: [PATCH 2/4] Create bcelndora.libraries.yml Adding libraries definition for theme overrides. --- bcelndora.libraries.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 bcelndora.libraries.yml diff --git a/bcelndora.libraries.yml b/bcelndora.libraries.yml new file mode 100644 index 0000000..9c3b4a6 --- /dev/null +++ b/bcelndora.libraries.yml @@ -0,0 +1,5 @@ +theme_overrides: + version: VERSION + css: + theme: + scss/styles.scss: {} From 9fd180d642da33884cf3dc11de35a831f312f47a Mon Sep 17 00:00:00 2001 From: MorganDawe Date: Tue, 2 Jul 2024 17:06:01 -0300 Subject: [PATCH 3/4] Update: Adding style override support. --- bcelndora.module | 1 + scss/_bcelndora-styles.scss | 1 + scss/styles.scss | 13 +++++++++++++ 3 files changed, 15 insertions(+) create mode 100644 scss/_bcelndora-styles.scss create mode 100644 scss/styles.scss diff --git a/bcelndora.module b/bcelndora.module index d702eaa..c4bb1ac 100644 --- a/bcelndora.module +++ b/bcelndora.module @@ -1,3 +1,4 @@ + Date: Tue, 2 Jul 2024 17:07:12 -0300 Subject: [PATCH 4/4] Removing sample test file. --- scss/_bcelndora-styles.scss | 1 - 1 file changed, 1 deletion(-) delete mode 100644 scss/_bcelndora-styles.scss diff --git a/scss/_bcelndora-styles.scss b/scss/_bcelndora-styles.scss deleted file mode 100644 index 8b13789..0000000 --- a/scss/_bcelndora-styles.scss +++ /dev/null @@ -1 +0,0 @@ -