- π¬π§United Kingdom vali hutchison
Here's the setup I used for a Drupal 10 site with a child theme. I created a folder called 'colorbox' in the root of my child theme folder and added my custom Colobox CSS and JS files to that folder. I then updated the *.libraries.yml file to include the Colorbox css and js files like this:
*.libraries.yml file before adding colobox:
global-styling: css: theme: css/style.css: {}
*.libraries.yml file after adding colobox:
global-styling: css: theme: css/style.css: {} colorbox/colorbox.css: {} js: colorbox/colorbox.js: {}
And that all worked.
Remember to clear Drupal caches after making these changes.
- Status changed to Closed: works as designed
8 months ago 7:28am 14 August 2024 - ivnish Kazakhstan
There is an official documentation about this https://www.drupal.org/docs/develop/creating-modules/adding-assets-css-j... β