Problem/Motivation
During #2375673: Split Bartik's CSS into SMACSS style components we've found that if we add a CSS file to a library with a name that already exists, that CSS never loads. It seems like the core CSS is overriding the theme CSS. This is a big WTF for themers.
We already have created way to override CSS files #575298: Provide non-PHP way to reliably override CSS but it has to be changed because its designed to remove a single file. If this functionality is left unchanged people would unintentionally override multiple files which has the same name.
Proposed resolution
Don't allow to override stylesheets anymore explicitly, so remove support for stylesheets-override in theme info files.
Therefore remove those information from the ActiveTheme object as well
Don't override CSS files that have the same name, let them to live in peace together. Stylesheet-override and stylesheet-remove have to be changed so themers can specify the CSS file they want to remove based on the location of the file:
# Remove a CSS file:
stylesheets-remove:
- core/node/css/node.css
The location of modules can change. In order to make it more stable we could add a placeholder that includes the location of the module or theme:
# Remove a CSS file:
stylesheets-remove:
- @node/css/node.css
API Changes
stylesheets-override will be removed because the way its built doesn't support theme hierarchy. There is follow-up issue to address this API change later: #2451411: Add libraries-override to themes' *.info.yml.
Beta phase evaluation
Issue category | Bug |
---|---|
Issue priority | Critical because an important part of the theme system is not working properly. |
Disruption | This will be a disruptive change, because we will modify the syntax for stylesheets-remove and stylesheets-override will be removed. This mus be done to fix the critical bug. |
Comment | File | Size | Author |
---|---|---|---|
#172 | core_and_base_theme_css-2389735-172.patch | 20.74 KB | lauriii |
#172 | interdiff.txt | 733 bytes | lauriii |
#170 | view-source_drupal8_dev_admin_content.png | 1.29 MB | LewisNyman |
#168 | core_and_base_theme_css-2389735-168.patch | 20.27 KB | lauriii |
#157 | interdiff.txt | 373 bytes | lauriii |
Comments
Comment #1
Wim LeersAFAICT this is by design, to make the
stylesheets-override
feature work. Drupal has been requiring unique CSS file names for a long time for that exact reason.Comment #2
LewisNymanIf we are encouraging themers to split up their CSS files into meaningful libraries, then the chances of an accidental override increases when we no longer have just a single style.css. There's no way to change this behaviour without breaking stylesheets-override?
Comment #3
Wim LeersI totally agree.
Actually, I think there is. :) Just require the full root-relative path to be used.
So, from this today:
to:
… which immediately also shows how this breaks down: contributed modules can live in different places.
So we'd want extension-relative paths:
This should work, since there can be only one extension with the same name at any time.
Caveat: before we change this, we should investigate why exactly
stylesheet-override
was made to work with filenames in the first place, to make sure we don't miss anything.Comment #4
loopduplicateI think I'm experiencing the same thing while trying to get a subtheme of Bartik for the Drupal 8 Multilingual Demo profile to work. Classy's layout.css is called instead of Bartik's.
The order of the libraries being loaded is wrong, as I saw by putting a breakpoint at line 1395 of /core/includes/theme.inc... The order should be: Classy, Bartik, Demotheme. Instead it's going: Bartik, Classy, Demotheme.
I found the cause to be in /Drupal/Core/Theme/ThemeInitialization, line 102. the $base_themes array is constructed in a way which puts parent themes after child themes. I'm attaching a patch which puts parent themes before child themes instead.
Comment #5
lauriiiSetting to needs review to trigger test bot
Comment #6
Gábor Hojtsy@Wim Leers: I think it was made to work with filenames originally because modules were supposed to provide their styles in one file, so you could override block.css or comment.css and there was no reason for paths to be provided. We are not on that basic level with CSS anymore :D
Note that @loopduplicate found this problem in #2392953: Update to beta4 - yml files out of date, adding role broken in our contrib distro that has a tiny subtheme of bartik and had issues with how theme stylesheets are merged in.
The patch needs a core test regardless even if we agree it is the way to go.
Comment #7
Gábor HojtsyExtending title to cover what the patch does, hope it covers the original problem as well :)
Comment #8
benjy CreditAttribution: benjy commentedPatch in #4 worked for me. I couldn't get my own CSS files to be included regardless of what they were called when subclassing Bartik.
Comment #9
Gábor HojtsyWe are now using this patch in the Multilingual demo distribution because it is required to make our contrib theme work, see https://www.drupal.org/project/multilingual_demo :)
Comment #10
LewisNymanhm, I recreated the original problem I found in #2375673: Split Bartik's CSS into SMACSS style components but it still doesn't load Bartik's CSS file.
Anything I'm missing?
Comment #11
Gábor Hojtsy#2414255: Subtheme template inheritance working in reverse order is a critical issues and essentially does the same thing for templates. Should we fold the two issues together? Join forces there, here?
Comment #12
davidhernandezWith the fix here, #2414255: Subtheme template inheritance working in reverse order it looks a css file with the same name as a parent theme file will replace the parent. That sounds like an improvement, but I don't think it is solving this problem, and letting the two co-exist. Can someone else test it?
Comment #13
Gábor Hojtsy@loopduplicate: can you still reproduce this one?
Comment #14
benjy CreditAttribution: benjy commented@Gabor, my comment from #8 still applies but the patch in #4 no longer fixes it for me.
Comment #15
markhalliwellI can verify that this is indeed a major bug (perhaps even critical, but I'll let someone else touch that).
I just spent 1.5hrs and having a serious Drupal WTF moment trying to figure out why my sub-theme of Bartik wasn't loading Bartik's layouts.css file. On the off chance that this issue may fix it, I applied that patch and it indeed fixed my issue.
Turns out that sub-sub-theme library inheritance doesn't work that well? Classy already declares
layout.css
and it was loading that file instead of Bartik's. However, when switching back to Baritk, it loads... so not entirely sure if this is the correct approach in the patch, but setting to CNW regardless for tests.Comment #16
davidhernandezOk, I'll do it. This is not a nice to have fixed. This is a must fix for subtheming. Let's figure out all the scenarios and get it working right.
Comment #17
iMiksuI'll try to write test for this.
Comment #18
iMiksuI wrote an test which overrides parent's same CSS file (and same path) and it looks like it works now, maybe this issue is not valid anymore? However, it would be ideal to have tests for that, so I've posted now the tests only AND with the patch provided above in comment #4.
Comment #19
dawehnerI kinda disagree with that bugfix ... the code in ThemeInitialization creates a ThemeActive object which explicitly has now documentation the order of base themes, which is not the way how you order it here.
Comment #20
davidhernandezIMiksu, I think the problems is we don't want to the subtheme CSS file to remove the parent theme CSS file. Both files should get included, even if they have the same name. Is that what you see happening?
The parent theme CSS file should only get overridden when using 'stylesheets-override' in the subtheme's info.yml file.
Comment #21
lauriiiI think that changes the logic we used to have in Drupal 7. Are we sure we want to change that?
Comment #24
iMiksuRight! Thanks for feedback, I'll change the tests accordingly, however I'm not sure yet how this will get fixed in the end, but tests will be needed anyhow!
Comment #25
hass CreditAttribution: hass commentedIf a subtheme adds the same file name like the base theme or a module it replaces the base theme or module file.
Comment #26
davidhernandezI believe that is why the .info overrides were added. Here is the change record. https://www.drupal.org/node/1876600
The overrides were added to make sure the theme/subtheme explicitly states what it does and does not want. If we continue to use name clashing as a way to override, it limits what a subtheme can name its files. It's also confusing, because you are removing the parent file even though you didnt use 'stylesheets-remove'.
Comment #27
iMiksuThis is now only the tests which should introduce two failures until both CSS files gets loaded as this issue proposes.
This still needs work on the fix, tests should be covered now hopefully.
Comment #28
lauriiiSetting to needs review to trigger testbot
Comment #30
iMiksuNice, did not saw that coming. It should have failed only against
Drupal\system\Tests\Theme\ThemeTest->testCSSWithSameNameAsInParent()
, here's new patch testing this. Should have only one fail.Comment #32
star-szr+1 to #26.
Comment #33
LewisNyman+10 to 26
Comment #34
dawehner+100 to 26
I would vote for simply getting rid of the automatic override.
Comment #35
Jeff Burnz CreditAttribution: Jeff Burnz commented#26 agree, we don't need automagical file removal anymore.
Comment #36
lauriiiThis will most likely break stylesheet-override and stylesheet-remove functionalities. I talked sportly with @alexpott and he suggested that we could try to move that functionality to hook_library_info_alter. Lets see how many tests we break with this.
Comment #38
lauriiiUps.. fixed gitignore so should be better now
Comment #40
markhalliwellOk, I can live with #26 (I wasn't aware of this new logic). The real "bug" then is in Bartik.
There's no
stylesheets-override
specified anywhere in bartik.info.yml:I'm still curious though why Bartik's layout.css loads, even without this override, and a sub-theme of Bartik doesn't.
Comment #41
markhalliwellHere's the issue that introduced Classy's layout.css file as a library asset instead of a simple .info.yml stylesheet entry.
Some key notes from that discussion is that stylesheets added to .info.yml files take precedence over libraries and supposedly if they're all libraries, they're handled "automatically"? Curious what that means exactly.
Comment #42
davidhernandezI don't see why this was changed to Bartik. This is not a Bartik specific problem.
Comment #43
star-szrStylesheets can't be added from .info.yml anymore: https://www.drupal.org/node/2379475
I just want to take a second to highlight #3 and #6.
At this time, I don't have a strong feeling on what the right way to go is here but I agree this is a more general bug than Bartik, so I'm reverting the metadata changes in #40 and adding "in libraries" to the issue title as a hopefully helpful keyword.
Building off of #3, what about something like this, using extension-based paths:
Comment #44
benjy CreditAttribution: benjy commentedI also have this exact same issue.
Comment #45
star-szrDigging through this related issue we come across some fun prior art like:
#575298-6: Provide non-PHP way to reliably override CSS
#575298-7: Provide non-PHP way to reliably override CSS
Comment #46
star-szrTo follow up on #40 / #43, if there is a working bug fix for the Bartik issue alone, that can be handled in a separate issue IMO.
Comment #47
lauriiiI removed all Javascript related changes because Javascripts are working how they should be. Lets see if this will fix the stylesheet-override an sytesheet-remove. Its dirty and slow but its progress :P
Comment #49
lauriiiShould apply now
Comment #51
Jeff Burnz CreditAttribution: Jeff Burnz commentedOne thing I might mention is that while we are using SMACCS we abandon it at the file naming level in themes, so why is that? E.g. why do we even have layout.css, should it not be bartik.layout.css, i.e how all modules are working right now, e.g. forum.theme.css.
If this were the case this issue effectively goes away? Do we want a more complex override/remove in info files, which are really their for the less technically inclined to start with?
I don't actually disagree with #26, just thinking this through.
Comment #52
lauriiiI removed all the crazy stuff I did for the stylesheet-override and remove because they were not broken. Sorry for misreading the code. This one should (finally) be green.
Comment #53
lauriiiI had a discussion in DrupalCamp London with @manuee and @alexpott about stylesheet-override and stylesheet-remove which both are being little bit broken and might have to be replaced with something like library-remove where you could remove complete libraries. Probelm is that if someone removes a CSS file in a info.yml file it will not load any of the files with that name, even from the same theme that way it would cause breaking things very easily. Also the stylesheet-override doesn't make that much sense after we've moved to use libraries because with it you would end up adding CSS files outside libraries. Probably it would still has to be there so single CSS files could be replaced and library dependencies would be kept in the original library.
Comment #54
star-szrIndeed, the biggest downside I see there is that you would end up clobbering JS as well when a library adds CSS and JS.
Comment #55
star-szrNon-critical follow-up to discuss improvements to stylesheets-override and stylesheets-remove, I'm thinking we don't need to tackle that here:
#2451411: Add libraries-override to themes' *.info.yml
Comment #57
LewisNymanActually we are using the SMACSS file naming conventions in themes, in modules we are using the MAT naming convention. MAT makes less sense in themes as as they don't need to be overridden by other themes, unless you have a base theme.
I can't imagine it being obvious/desirable to themers that they have to prefix all their stylesheets with the name of their theme.
Comment #58
lauriiiWe have tests, thanks @iMiksu!
Comment #59
Jeff Burnz CreditAttribution: Jeff Burnz commentedLewis, I'm agnostic about how things are done, although I have implemented a system that names spaces like this and it has not been an issue. I always saw MAT as just an implementation of SMACCS just adapted to our use case in terms of naming and grouping convention. Sorry for the noise if any!
Comment #60
dawehnerIf we want to do that, which sounds sane for me, we probably need a change record documenting this.
Comment #61
lauriiiComment #62
Wim LeersPatch looks sane and definitely very simple. Here's a quick review.
Depending on the type, some options may need some processing.
s/needs/need/
s/its being/it is/
s/the stylesheet override and remove functionalities/overriding and removing stylesheets/
This phrase could use some clean-up.
Incomplete comment.
Comment #63
lauriiiComment #64
lauriiiFixed 1 & 2
Comment #65
davidhernandezJust had a thought. Instead of testing CSS files with the same name using test_theme and Classy, we should use test_basetheme and test_subtheme. Add CSS files to them and test them. That is what they are there for, correct?
That way if we figure out how to get rid of that empty CSS file in Classy we won't need to keep it just for tests.
Comment #66
star-szr+1 to that, if we don't have to make the tests depend on Classy then let's not.
Comment #67
davidhernandezThere is a method that already exists in Drupal\system\Tests\Theme\ThemeInfoTest for testing the presence of stylesheets in base theme and subtheme. I'll add it there.
Comment #68
davidhernandezThis would remove the need to fix #62 3 and 4.
Comment #70
davidhernandezComment #71
davidhernandezSince this just fixes the stylesheet linking bug, and the more developer facing change will actually happen in #2451411: Add libraries-override to themes' *.info.yml, I don't think this needs a change record. Agree or disagree?
Comment #72
star-szrAgree.
Comment #73
davidhernandezComment #74
lauriiiPoints from #62 are fixed. Also improvements by David are good.
Comment #75
Wim LeersOnly nits.
Replace with: "Depending on the type, some options may need some processing."I meant: remove — we *always* key it by full path; it's pointless to state it there, especially because it doesn't even happen there, it happens far lower.
(As said in #62.)
A nice side-effect: now CSS & JS are consistent again!
Actual code changes + test coverage look perfect.
Comment #76
davidhernandezFixing #75 1.
Comment #77
lauriii#75 fixed
Comment #78
Wim LeersRTBC+1
Comment #79
alexpottBut doesn't this make stylesheets-override and stylesheets-remove work in a very odd way? Like the override would override 2 css entries?
Comment #80
davidhernandez@alexpott, is that not case currently? Local files are keyed by the basename, so it is not possible to add more than one stylesheet with the same name. We are fixing the add more than one problem, and hopefully fixing stylesheets/library-remove problems in #2451411: Add libraries-override to themes' *.info.yml.
Comment #81
davidhernandezAdding beta eval.
Comment #82
alexpott@davidhernandez but this patch changes the behaviour. Prior to this patch it was possible to only have one dialog.css loaded. So we you need an override you knew that you where overriding one file. Now, if you have 2 dialog.css files then it will replace both, right?
Comment #83
davidhernandez@alexpott, yes, both get removed.
(Assuming this patch)
If you create a CSS file with the same name as one added by a base theme or module, you can add your file. All will be linked. If you use stylesheets-override, all the files will be overridden and linked to the same file (not good.) If stylesheets-remove is used, all files with the name are removed.
We seemed to be stuck in a spot where the functionality is awkward, but the awkwardness was not created here, it was exposed here. I think part of it being that we are only partly embracing libraries, not completely.
We can have stylesheets-override check for uniqueness, but we need more specific keying for stylesheets-remove to target a specific file. Doing that turns this from a bug fix into a real API change to get specificity in the .info.yml file. How to do that is part of what is being discussed in #2451411: Add libraries-override to themes' *.info.yml. In that issue we've talked about embracing the library way, but I don't want to change an API here, and then change it again there.
Should we fix this one, and escalate #2451411?
Comment #84
alexpott@effulgentsia, @webchick, @xjm and I discussed this and agreed that this is a critical because we should allow different extensions to provide css with the same name. Also this bug would be really hard to track down.
Re #83 tbh I think we need to address #2451411: Add libraries-override to themes' *.info.yml in this issue. Since this changes what an override or remove can do. Because before you knew you were targeting the only instance of the css that was loaded - now you might be targeting multiple css files.
Comment #85
lauriiiSo we can get #2451411: Add libraries-override to themes' *.info.yml to this issue
Comment #86
lauriiiComment #87
davidhernandezShould we just fix stylesheets-override and -remove here and leave the library addition for the other issue, since that might be a lot more work?
Comment #88
dawehnerThis sounds for me like the right thing to do, honestly. One change of functionality is good, two separate ones are worse, as it also discourages people from thinking about one properly.
Comment #89
larowlanCan we get an update on remaining tasks/proposed resolution, thanks in advance
Comment #90
LewisNymanI've updated the issue summary with Lauriii
Comment #91
lauriiiComment #92
lauriiiComment #94
davidhernandezI prefer using the "@node/css/node.css" syntax, since it is the same method we use in other places like template extends. It is also a little easier to use.
I updated the beta evaluation. This is now a disruptive change.
Comment #95
lauriiiCreated the initial code to replace placeholders from the stylesheets-remove and stylesheets-override.
I think we need to test if this approach works with vendor stylesheet files.
Comment #96
lauriiiUps forgot to attach interdiff
Comment #98
hass CreditAttribution: hass commentedDavid: we no longer need to write @ for template extends references. Theme registry manages all for you... and this is very good as it works like twig works by default.
Comment #99
davidhernandezThat is correct now for most uses cases, because of the theme registry, but in cases where specificity is needed we still need the @ syntax. This is mostly for when the template has the same name as the one it extends. For example, in Bartik:
Comment #100
hass CreditAttribution: hass commentedInterresting. Wasn't aware of this.
Comment #101
lauriiiSome progress I've made. Probably need to talk to someone because removing overriden files is a bit problematic.
Comment #102
lauriiiComment #104
lauriiiI talked with @alexpott about the stylesheet-override and we both agreed that the stylesheet-override should be removed in order to create sanity for the assets. The problem we have with the stylesheet-override comes when there is multiple base themes and someone wants to override a CSS in one theme and remove it later on in other theme. Anyway everything stylesheet-override is doing is easily achieved by using hook_library_alter.
Comment #105
xjmComment #106
lauriiiStarted removing stylesheet-override and realised that this would have to be fixed first: #2050269: hook_library_info_alter() is not called for themes
Comment #107
lauriiiComment #109
LewisNymanI've posted a comment asking for some feedback from the contributors to #575298: Provide non-PHP way to reliably override CSS
I am a little concerned that we are removing something we added for good reason, themers do this all the time and don't like writing PHP ;-)
What would the change record look like for this issue?
Comment #110
davidhernandezAgreeing with Lewis. The whole point of functionality like this is to allow themers to make these changes without writing code. Telling themers to use hook_library_alter to manage stylesheets is not an optimal solution.
What is the problem that occurs when the parent theme overrides (with lauriii's patch) and the child theme wants to remove? Is it just not possible? What is the result?
Can anyone predict if we will have these same problems in #2451411: Add libraries-override to themes' *.info.yml ?
Comment #111
lauriiiComment #112
yannickooNice lauriii, your patch has also fixed #2442169: Views tabs styling is broken :)
Comment #113
lauriiiComment #114
lauriii@davidhernandez things get complicated when there is multiple levels of themes. Lets say base_theme overrides a CSS file and subtheme wants to remove that, should it be removing the one that has been already overridden or the original one? Things get even complicated when there is more levels. I don't think that would be easy enough to understand what it does. I would say 90% of the themers who want to modify the CSS files coming from core wants to just nuke all or some of the core css files away without caring about dependencies etc. Anyway they are more important with Javascript. For those people who wants to care about the dependencies we could provide documentation how they can do it using PHP.
Comment #117
lauriiiComment #118
lauriiiI discussed about this with @lewisnyman and he agreed that it might not be useful to have stylesheet-override as we could have it because it would be still hard to use and expected what the overrides do in more complicated situations.
Comment #119
LewisNymanI still think we should assess the php we are expecting themers to write to recreate this functionality.
Comment #120
davidhernandez@lauriii, do you mean what the themer targets or what the stylesheets-remove function targets? I wouldn't think there is a problem with the function, because we are increasing specificity. Using @base_theme/css/style.css means there should be no confusion as to what the function targets. It targets the file you tell it to target, in the module or theme you specifiy. I think in the case you brought up, you would probably have to add a remove line for both css files. Possibly annoying, but a lot better than adding a php function.
Comment #121
lauriiiWouldn't it be less annoying to write (copy-paste) few lines of PHP if you would then know what you are doing?
I mean it gets a lot complex because now someone can first remove something, then override on next level and remove after that.
Btw. what if override is added to base theme afterwards? It will remove its children's removes and overrides (same applies other way around)? On the override situation you wouldn't be only relying on the original CSS file but the base themes override.. In hook_library_alter you would be able to build whatever logic is needed and it would be easier to not break things.
I just doesn't feel like clever option to create huge amount of logic behind something that most of the people doesn't need. Also other point is that it would be way more fragile than hook_library_alter.
Comment #122
lauriiiUsing PHP this would be:
OR
Comment #123
davidhernandezIt might be easy for a coder that understands PHP, but there are lots of themers who look at 3 lines of PHP and get lost. Especially, for something that can be as complicated as an alter. If we are stuck using the alter as the only solution so we can fix a critical bug, we'll deal with it, but that is not a themer-centric solution. That is a develop-centric solution.
Just looking at that code snippet now. That is damn complicated for someone that doesn't understand how any of this works.
Comment #124
Wim LeersThis can now also be removed, right? It's not used anywhere.
Comment #125
alexpottThe problem here is that we can't have our cake and eat it too. With theme inheritance and libraries we get a lot power - but that means we can't have a simple way of overriding an individual part of a library.
By providing a stylesheet-remove option, themes can easily get rid of stuff. If they need to override and don't want to write the necessary PHP to alter a library they can remove the CSS using the same option and just add the css to every page after removing the css.
Comment #126
lauriiiWe need to add API changes to the issue summary.
Comment #127
Wim Leers#125: the answer to that is IMHO something like #2451411-9: Add libraries-override to themes' *.info.yml:
Comment #128
lauriii@Wim: I agree with you.
I think the question is that we can still keep libraries-override in its own issue and fix as an follow up for this? Or do we have to address the fix for that in this issue.
Comment #129
davidhernandezYes, Wim's libraries solution in #2451411: Add libraries-override to themes' *.info.yml is the preferred endpoint. We're just going to end up stuck with a step in between. We need to fix this critical bug, which may leave us with only stylesheets-remove, and then try to work on the library issue. I'm concerned that since that issue isn't critical it may not get in. So what is done here might be what we have for release.
At worst, we can probably have it in 8.1, correct? Since it would be an addition.
Comment #130
lauriiiRerolled and fixed Seven themes overrides.
Comment #131
LewisNymanI like Wim's proposal. I'm happy to remove this functionality and later we can implement that. The code implementation is not good but if Alex is ok with it I am as well.
Comment #132
lauriiiChanged the patch to use hook_library_info_alter because hook_library_alter will be removed from Drupal.
Comment #133
dawehnerNote: you can inject
'%container.modules%'
to get that kind of information from the container ...That seems to be a method which does not need to be public, right?
Comment #134
lauriiiThanks @dawehner for the review and suggestions!
Comment #136
lauriiiRollbacking other change because module_list doesn't provide proper way to get the path for a module. We also cannot inject moduleHandler through services container because that would cause circulal dependencies.
Comment #137
Wim LeersPinged @dawehner for review.
Comment #138
dawehnerAre you sure about that?
Can we inject the module handler, please then?
Ideally we load the extensions on the fly ... as on a normal page request, we should not need to rebuild the active theme object, but rather use the stored entry in state.
Comment #139
Wim Leerslauriii said
Comment #140
lauriiiAnd the information we have in the container.modules would have to be putted into to Extension object which I don't think is very nice.
Comment #141
lauriiiThanks @dawehner for sorting this out for me on IRC!
Comment #142
lauriiiWe still need change record
Comment #143
dawehnerComment #144
dawehnerYeah sometimes things just work, if you do them right!
Comment #145
lauriiiThere was still single extra line on seven.theme file.
Comment #146
davidhernandezCan we add some reasoning to the change record? If people only look at the CR they will not understand why it was removed, since the new method is more complicated.
Comment #147
lauriiiI added some reasoning and kitten pictures so themers don't have to be sad :)
Comment #148
alexpottExtra blank line
Let's only do the merge if we need to.
Returns a string
Missing ModuleHandler from @param docs.
This should be $css_file and is a string and needs docs.
Comment #149
lauriiiFixed @alexpotts points
Comment #151
joelpittet@lauriii I have some fixes for the project loading issue that may be related: #2413695: Modules getting installed in the theme directory if they don't have a *.module file, it just needs some tests.
Comment #152
larowlanFixes fails
Comment #153
lauriiiComment #154
alexpottI think this would be better as:
Comment #155
lauriiiComment #156
dawehnerWell fair, I still like
buildExtensions()
a bit better, but its alright.Comment #157
lauriiiJust a very little change for sevens info.yml file.
Comment #158
alexpottLet's add a test for that then.
Comment #159
alexpottre #158 .... so there is no SevenThemeTest so let's handle that in a followup.
Comment #160
alexpottWe need another change record to tell people about this.
Comment #161
davidhernandezThe comments in ThemeInfoTest.php should be updated, as they still mention stylesheets-override.
test_theme.info.yml has a stylesheets-remove line that I think needs updating.
Stark has a styleheets-remove line that needs updating.
Comment #162
lauriiiComment #163
lauriiiCR is done
Comment #164
lauriiiFixed #161
Comment #165
davidhernandezIf #155 was RTBC, #164 addresses everything after.
Comment #166
joelpittetThis simplifies things a lot! Big thanks @lauriii and @davidhernandez for taking this on and everybody for contributing to it's current state! Awesome work!
Edit: scratch that @lauriii already created the follow-up.
@alexpott re #158 ping me on IRC with what you'd like to see in the seven tests follow-up and I'll create the IS. My guess is "Test that core dialog css doesn't appear on page when seven theme is enabled"?Comment #167
lauriiiI will still manually test this
Comment #168
lauriiiI will ask Lewis Nyman to review last changes because they mostly relate to Seven theme.
Comment #169
lauriiiComment #170
LewisNymanI applied the patch and one of the differences are the loading order of the jqueryui/theme.css file. It doesn't cause a problem though. The other side effect is that classy's layout.css file is loaded now, because it was previously being replaced by Seven's layout.css. The order of the base theme CSS is wrong, but that is already wrong in HEAD.
Comment #171
davidhernandezThis is expected, since we fixed the problem that was causing it not to load. Ultimately, we want to get rid of that layout file, which is a separate issue, but we could add it to stylesheets-remove for both Seven and Bartik.
That is a problem. We had that fixed at one point. The screenshot shows Classy's layout file getting added after Seven's. It should be the other way around.
Comment #172
lauriiiI fixed the first point. The order is wrong also on head and there is separated issue for that #2474091: CSS files from themes are being loaded in reversed order
Comment #173
Anonymous (not verified) CreditAttribution: Anonymous at Druid commentedlatest patch seems to fix #171
Comment #174
alexpottThe consistency of how css is inherited from base themes will be important in Drupal 8 since we have Classy. Thanks @lauriii for sticking with this and ironing out all the complexity. See you all in #2474091: CSS files from themes are being loaded in reversed order. This issue addresses a critical bug and is allowed per https://www.drupal.org/core/beta-changes. Committed 0fb8f6b and pushed to 8.0.x. Thanks!
Comment #176
davidhernandezI published the change records.
Comment #177
Wim LeersNext step: #2451411: Add libraries-override to themes' *.info.yml.
Comment #178
neclimdulprefixing yaml tokens with @ is invalid. A bug in Symfony's yaml parser allows this but it will block other parsers from being able to read our yaml files.
Comment #179
neclimdulSorry, meant NW. I re-opened this because it was a specific design decision. A possible solution though would be to open a follow up to update CR, documentation, and code with quoting the string. This is what migrate did a couple weeks ago after I brought the same problem to their developers.
Comment #180
dawehner@neclimdul Would be using
'@foo/bar'
be okay instead? I see that the services.yml files do that all over the place, don't they?Comment #181
joelpittetThanks for the report and +1 to #180 string and maybe document this gotcha in the theming guide.
Comment #182
davidhernandezIf that syntax is correct, we can open a follow up issue and patch the core info files. Also, change update the change record and maybe add another one to clarify?
Comment #183
davidhernandezI created a follow up. #2481183: Quote tokens in theme .info.yml files