Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style overrides #20

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bcelndora.libraries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
theme_overrides:
version: VERSION
css:
theme:
scss/styles.scss: {}
37 changes: 37 additions & 0 deletions bcelndora.module
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

/**
* @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']);
}
}
13 changes: 13 additions & 0 deletions scss/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Include icon loading directory.
$icon-font-path: "../../../themes/contrib/dgi_i8_base/bootstrap/assets/fonts/bootstrap/";

// Import default variables.
@import "default-variables"; // From dgi_i8_base

// Import base styles.
@import "base-styles"; // From dgi_i8_base

// Import BCELN Overrides, best organized into directories.
// EX: @import "components/header/header" to import styles from
// this modules "components/header/_header.scss" file;