rdrew 1 month ago
commit
fa264ca415
  1. 3
      css/theme-overrides-scholar.css
  2. 0
      js/theme-overrides-scholar.js
  3. 8
      theme_overrides_scholar.info.yml
  4. 11
      theme_overrides_scholar.libraries.yml
  5. 27
      theme_overrides_scholar.module

3
css/theme-overrides-scholar.css

@ -0,0 +1,3 @@
.test {
background: #000;
}

0
js/theme-overrides-scholar.js

8
theme_overrides_scholar.info.yml

@ -0,0 +1,8 @@
name: theme_overrides_scholar
type: module
description: Provides additional functionality for the site.
package: Custom
core_version_requirement: ^9 || ^10
libraries:
- theme_overrides_scholar/global

11
theme_overrides_scholar.libraries.yml

@ -0,0 +1,11 @@
# Custom module library for general purposes.
global:
js:
js/theme-overrides-scholar.js: {}
css:
theme:
css/theme-overrides-scholar.css: {}
dependencies:
- core/drupalSettings
#- theme_overrides/jquery-labelauty

27
theme_overrides_scholar.module

@ -0,0 +1,27 @@
<?php
/**
* @file
* Primary module hooks for theme_overrides_scholar module.
*/
use Drupal\Core\Asset\AttachedAssetsInterface;
/**
* Implements hook_css_alter().
*/
function theme_overrides_scholar_css_alter(&$css, AttachedAssetsInterface $assets) {
$library = \Drupal::service('library.discovery')->getLibraryByName('theme_overrides_scholar', 'global');
$path = $library['css'][0]['data'];
if (isset($css[$path])) {
$css[$path]['group'] = 300;
}
}
function theme_overrides_scholar_page_attachments(&$variables) {
$variables['#attached']['library'][] = 'theme_overrides_scholar/global';
}
Loading…
Cancel
Save