For this project I'm using Adaptive Theme, but basically this approach does not depend on the base theme.
Steps to add your css and/or js files:
- Define a new library in your themes yourthemename.libraries.yml
- Add a reference to your new library in yourthemes yourthemename.info.yml
Let's have a look at an example where we are going to add mystylesheet.css and myscript.js to our theme and load it on every page of this site. Our theme directory is called yourthemename.
- Create the file public_html/themes/yourtheme/styles/css/mystylesheet.css
- Create the file public_html/themes/yourtheme/scripts/myscript.js
- Define a new library called global-styling in public_html/themes/yourtheme/yourtheme.libraries.yml and add the following code: