Browse Source

fixed

master
rdrew 7 months ago
parent
commit
81ed73409a
  1. 3
      css/theme-overrides.css
  2. 0
      css/theme_overrides.css
  3. 0
      js/theme_overrides.js
  4. 3
      theme_overrides.info.yml
  5. 4
      theme_overrides.libraries.yml
  6. 21
      theme_overrides.module

3
css/theme-overrides.css

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

0
css/theme_overrides.css

0
js/theme_overrides.js

3
theme_overrides.info.yml

@ -3,3 +3,6 @@ type: module
description: Provides additional functionality for the site. description: Provides additional functionality for the site.
package: Custom package: Custom
core_version_requirement: ^9 || ^10 core_version_requirement: ^9 || ^10
libraries:
- theme_overrides/global

4
theme_overrides.libraries.yml

@ -1,9 +1,9 @@
# Custom module library for general purposes. # Custom module library for general purposes.
theme_overrides: global:
js: js:
js/theme-overrides.js: {} js/theme-overrides.js: {}
css: css:
component: theme:
css/theme-overrides.css: {} css/theme-overrides.css: {}
dependencies: dependencies:
- core/drupalSettings - core/drupalSettings

21
theme_overrides.module

@ -4,3 +4,24 @@
* @file * @file
* Primary module hooks for theme_overrides module. * Primary module hooks for theme_overrides module.
*/ */
use Drupal\Core\Asset\AttachedAssetsInterface;
/**
* Implements hook_css_alter().
*/
function theme_overrides_css_alter(&$css, AttachedAssetsInterface $assets) {
$library = \Drupal::service('library.discovery')->getLibraryByName('theme_overrides', 'global');
$path = $library['css'][0]['data'];
if (isset($css[$path])) {
$css[$path]['group'] = 300;
}
}
function theme_overrides_page_attachments(&$variables) {
$variables['#attached']['library'][] = 'theme_overrides/global';
}

Loading…
Cancel
Save