0

I am using admin_toolbar module and I would like to override the path to a logo file that is by default provided by one of this module's CSS file.

I found information that I can achieve this with libraries-override in my theme.info.yml file.

The problem is that the file seems to be still loaded when I check the page source.

The file that defines the path to a logo file is located in:

/modules/contrib/admin_toolbar/admin_toolbar_tools/css/tools.css

And my theme.info.yml file looks like this:

name: Custom Olivero Theme
type: theme
description: 'Custom Olivero Theme.'
package: Custom Themes
core_version_requirement: ^8 || ^9
libraries:
  - custom_olivero/global-styling
base theme: olivero
libraries-override:
  admin_toolbar_tools/toolbar.icon:
    css:
      theme:
        /modules/contrib/admin_toolbar/admin_toolbar_tools/css/tools.css: false

Can you please share any suggestions on what am I doing wrong or, if this approach is not following the good Drupal practices, suggest what is the better way of achieving the same result?

1 Answer 1

2

The content of the admin_toolbar_tools.libraries.yml file is the following.

toolbar.icon:
  css:
    theme:
      css/tools.css: {}

You remove that file with the following override.

libraries-override:
  admin_toolbar_tools/toolbar.icon:
    css:
      theme:
        css/tools.css: false

You do not need to use the full file path, but the path used in the .libraries.yml file for that module.

1
  • Thank you. Changing the path worked!
    – Adamssef
    Commented Jun 5, 2023 at 7:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.