Score:2

How to remove a css file from an already-overridden definition?

US flag
user106880

I want to create a custom theme and remove a css file from diretory themes/stable/css/filter.caption.css from Stable theme. I found this file in stable.info.yml

libraries-override:
  filter/caption:
    css:
      component:
          css/filter.caption.css: css/filter/filter.caption.css

From my_custom.info.yml

libraries-override:
  filter/caption:
    css:
      component:
        css/filter.caption.css: false

or

libraries-override:
  filter/caption:
    css:
      component:
        css/filter/filter.caption.css: false

I tried that way but it is not work to remove a css file themes/statble/css/filter.caption.css.

id flag
This seems to have been asked a few times here in the past.
id flag
Does this answer your question? [How can I override or disable a parent theme's CSS file?](https://drupal.stackexchange.com/questions/182528/how-can-i-override-or-disable-a-parent-themes-css-file)
id flag
This may be an open bug in Drupal, but there are workarounds: https://www.drupal.org/project/drupal/issues/2642122
Score:3
US flag
user106880

In stable.info.yml we have

libraries-override:
  filter/caption:
     css:
       component:
         css/filter.caption.css: css/filter/filter.caption.css

So my_theme.info.yml to disable it could be:

libraries-override:
  filter/caption:
    css:
      component:
        /themes/contrib/stable/css/filter/filter.caption.css: false

A bug in libraries-override makes it difficult to override a library or library asset that has already been overridden. See https://www.drupal.org/project/drupal/issues/2642122#comment-11830072 for more information.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.