Last active
August 25, 2020 22:59
-
-
Save jasonjflaherty/9b9823e9f1ce83fc307565ccdc3b2c07 to your computer and use it in GitHub Desktop.
Drupal 8 Include Library with Custom Module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* add to MODULE_NAME.info.yml */ | |
libraries: | |
- module_name/mncss | |
/* add to MODULE_NAME.libraries.yaml */ | |
mncss: | |
version: "1.x" | |
css: | |
theme: | |
css/styleforms.css: {} | |
/* add to .module file */ | |
function module_name_preprocess_page(&$vars){ | |
$vars['#attached']['library'][] = 'module_name/mncss'; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment