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
Comments
Comment #2
mortendk CreditAttribution: mortendk as a volunteer commentedComment #3
mortendk CreditAttribution: mortendk as a volunteer commentedComment #4
vdanielpop CreditAttribution: vdanielpop as a volunteer and at PitechPlus commentedHow 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.
Comment #5
almaudoh CreditAttribution: almaudoh commentedThere'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.
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.
Comment #7
Chi CreditAttribution: Chi commentedDoes it? I could not get it working on seven subtheme.
Comment #11
almaudoh CreditAttribution: almaudoh commentedPatch at https://www.drupal.org/project/drupal/issues/2642122#comment-13240019 that fixes this needs reviews.
Comment #14
djsagar CreditAttribution: djsagar at OpenSense Labs commentedHi @mortendk
Try this, this is the right example which you are looking for
Please let me know it's solve your problem or not.
Comment #19
smustgrave CreditAttribution: smustgrave at Mobomo commentedIf #14 solves the issue.