Problem/Motivation

The path logic is painful when using sub themes to overwriting libraries.

Lets say we have 2 themes : base and subtheme
If I want to remove the toolbar.theme.css in my basetheme (base) and i set my active theme set to "subtheme"

name: base
type: theme
base theme: classy

libraries-override:
  toolbar/toolbar:
    css:
      theme:
        css/toolbar.theme.css: false

subtheme:

name: subtheme
type: theme
base theme: base
core: '8.x'

Oki so that works fine toolbar.theme.css is removed when i use my subtheme, and it "inherits" the removing of toolbar.theme.css

But if I wanna do the same with a the theme that do not uses a subtheme i have to change the paths

name: basedrop
type: theme
base theme: stable # or classy
core: '8.x'

libraries-override:
  toolbar/toolbar:
    css:
      theme:
        /core/themes/stable/css/toolbar/toolbar.theme.css: false

The path for toolbar.theme.css have to be set to now to /core/themes/stable/css/toolbar/toolbar.theme.css instead of css/toolbar.theme.css: false thats kinda confusing

Proposed resolution

make paths for overwriting core allways be the same path

Remaining tasks

User interface changes

API changes

Data model changes

Comments

mortendk created an issue. See original summary.

mortendk’s picture

Issue summary: View changes
mortendk’s picture

Issue summary: View changes
vdanielpop’s picture

How do you think this should work? The specified file should be taken into consideration only when a file with the same path doesn't exist in the current theme's directory?
That doesn't feel quite right.

almaudoh’s picture

There's a new patch over at #2642122: Overriding already overridden libraries-override requires knowledge of previous libraries-overrides that fixes this bug now and needs reviews and testing.

How do you think this should work?

I think the signature of a libraries-override should remain the same for specific library, irrespective of the thememail in which it is declared.

The reason why it is different for stable is that stable overrides almost all the libraries, while classy doesn't.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Chi’s picture

it "inherits" the removing of toolbar.theme.css

Does it? I could not get it working on seven subtheme.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

almaudoh’s picture

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

djsagar’s picture

Status: Active » Needs review

Hi @mortendk

Try this, this is the right example which you are looking for

Please let me know it's solve your problem or not.

 - seven/global-styling
libraries-override:
  system/base:
    css:
      component:
        /core/themes/stable/css/system/components/system-status-counter.css: css/components/system-status-counter.css
  core/drupal.vertical-tabs:
    css:
      component:
        misc/vertical-tabs.css: false
  core/jquery.ui:
    css:
      theme:
        assets/vendor/jquery.ui/themes/base/theme.css: false
  core/jquery.ui.dialog:
    css:
      component:
        assets/vendor/jquery.ui/themes/base/dialog.css: false
  classy/dialog:
    seven/seven.drupal.dialog
  classy/base:
    css:
      component:
        css/components/details.css: false

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Needs review » Postponed (maintainer needs more info)

If #14 solves the issue.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.