March 2019
Intermediate to advanced
580 pages
15h 3m
English
Assuming that you already have the CSS/JS files, libraries are defined inside a module_name.libraries.yml file in the module root folder. A simple example of a library definition inside this file would look like this:
my-library: version: 1.x css: theme: css/my_library.css: {} js: js/my_library.js: {}
This is a standard YAML notation by which we define a library called my-library and provide some information about it. We can specify a version number and then add as many CSS and JS file references as we need. The file paths are relative to the module folder this library definition is in, and we can add some options between the curly braces (more advanced, but we will see an example in a moment).
Additionally, you'll note that the ...
Read now
Unlock full access