Skip to content
Merged
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
10 changes: 6 additions & 4 deletions localgov_core.module
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ function localgov_core_theme($existing, $type, $theme, $path) {
/**
* Implements hook_library_info_alter().
*/
function localgov_core_library_info_alter(&$libraries, $extension) {
function localgov_core_library_info_alter(&$libraries, $extension): void {

if ($extension === 'core') {
$remove_css = (bool) theme_get_setting('localgov_base_remove_css');
$remove_js = (bool) theme_get_setting('localgov_base_remove_js');

foreach($libraries as $name => $library) {
foreach ($libraries as $name => $library) {
if (str_starts_with($name, 'components.localgov_base--')) {
if ($remove_css) {
$libraries[$name]['css'] = [];
Expand All @@ -46,6 +46,8 @@ function localgov_core_library_info_alter(&$libraries, $extension) {
}
}

}

/**
* Implements hook_theme_suggestions_HOOK().
*/
Expand All @@ -68,7 +70,7 @@ function localgov_core_theme_suggestions_localgov_page_header_block(array $varia
/**
* Implements hook_template_preprocess_default_variables_alter().
*/
function localgov_core_template_preprocess_default_variables_alter(&$variables) {
function localgov_core_template_preprocess_default_variables_alter(&$variables): void {
$remove_css = (bool) theme_get_setting('localgov_base_remove_css');
$remove_js = (bool) theme_get_setting('localgov_base_remove_js');

Expand Down