Notes on creating an Octavia subtheme for Drutopia
Currently we need a hook_library_info_alter() in order to replace Bulma’s inclusion of bulma CSS with our own (so we can use the power of Sass, including setting variables that are incorporated throughout the framework). https://gitlab.com/uc-davis/patient-hm-brain/blob/master/web/themes/custom/henry/henry.theme
In this sense, we are following precisely how Octavia does it: https://gitlab.com/drutopia/octavia/blob/8.x-1.x/octavia.theme
It’s a tad confusing in the sense that no matter how many subsubsubthemes you might go, you’re always overriding Bulma theme’s global css base, not any of the intermediate subthemes.
Is this a better way to do it? https://www.drupal.org/docs/8/theming-drupal-8/adding-stylesheets-css-and-javascript-js-to-a-drupal-8-theme#override-extend (via https://www.drupal.org/node/2497313)
TODO study how Hubs4Change’s Enzian theme handles this: https://gitlab.com/geeks4change/hubs4change/enzian/blob/master/enzian.libraries.yml
What wwas working fine up through at least Drupal 8.7.1:
In my subtheme of Octavia, which needed to override the overriding that Octavia did:
bulma/global:
css:
base:
- assets/bulma/css/bulma.css: dist/css/global.css
+ /themes/contrib/octavia/dist/css/bulma.css: dist/css/global.css
Override the Bulma CSS that Octavia is overriding
There's a bug that requires giving the absolute path:
https://www.drupal.org/project/drupal/issues/2642122#comment-10705712
Doing it this way (or the way Octavia itself does it) is important so that the order
of loading is maintained; this way Bulma with all our customizations can still give
precedence to the corrections that Bulma theme and Octavia provided, because those
overrides are loaded after our customized Bulma.