Libraries can also be overridden to modify assets declared by other libraries, possibly added by a base theme, a module, or even the Drupal core. The ability to override libraries includes removing as well as replacing assets altogether. The same way we reference a library from our *.info.yml file, we can override libraries by adding the following:
libraries-override:
# Replace an entire library.
core/drupal.vertical-tabs: example/vertical-tabs
# Replace an asset with another.
core/drupal.vertical-tabs:
css:
component:
misc/vertical-tabs.css: css/vertical-tabs.css
# Remove an asset.
core/drupal.vertical-tabs:
css:
component:
misc/vertical-tabs.css: false
# Remove an entire library.
core/modernizr: false
In this case, the libraries-override configuration achieves something different for each line. Whether it is replacing an entire library or removing an asset, we now have the flexibility to control assets.