Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Turning cache on breaks the theme in firefox, in Safari it works but not in firefox, I can't figure it out. Why would it work when it's turned off but not when it's turned on ?
Comments
Comment #1
darumaki CreditAttribution: darumaki commentedI also confirmed this with a fresh download of Deco and still same,
Comment #2
Manuel Garcia CreditAttribution: Manuel Garcia commentedIt seems to break when css agregation is turned on, not all of it but enough to make me turn it off.
Comment #3
darumaki CreditAttribution: darumaki commentedyes, that's what I meant css aggregation,
update I think I found the problem, css aggregator doesn't take too kindly to the @CHARSET "UTF-8"; at the top of the file and also the @import css. When removing these, everything went ok with theme.
solution found here http://drupal.org/node/122938
Comment #4
Olarin CreditAttribution: Olarin commentedwe've been getting some problems too, with our own modified version of deco.
http://drupal.org/node/168620 has a patch that was committed to core last year which should have resolved the charset problem in css caching, so the problem is more likely with the @import calls, yes? or am i missing something?
Comment #5
Olarin CreditAttribution: Olarin commentedhm, @import calls should also already be fixed - in the patch from http://drupal.org/node/113607
Comment #6
Olarin CreditAttribution: Olarin commentedTo (attempt to) clarify what I said above:
darumaki links to a thread that mentions two problems the zen theme ran into with css caching:
- css files with "@CHARSET" don't work right under css aggregation
- css aggregation moves "@import" calls from all files to the top of the cache, also breaking the theme
darumaki said that removing @charset and @import lines from the theme fixes the problem in their installation. However, the @charset problem should have already been dealt with according to the first link I posted (css aggregation now omits @charset calls when aggregating), and the @import problem should have already been dealt with according to the second link I posted (css aggregation now recursively replaces @import calls with the css files imported rather than just moving the import calls), so neither of these things SHOULD be a problem any more, so this seems very odd. I haven't had a chance to test whether removing those lines in our installation solves the problem for us.
Comment #7
darumaki CreditAttribution: darumaki commentedI can assure you, the problem still exists, I had to remove them from the CSS file and that fixed it.
Comment #8
Olarin CreditAttribution: Olarin commentedI'm not doubting you, I'm just saying it suggests the possibility that something is seriously wrong in core - perhaps some sort of browser-specific handling that negates the original fixes I linked to?
Comment #9
Olarin CreditAttribution: Olarin commentedOk, I had a chance to test on our site and I've narrowed down the problem.
darumaki was right, or at least half right. The @CHARSET calls are not causing any trouble, but the @import calls certainly are. The correct fix (for now) is not just to remove them, but to replace them with the code they are trying to import. The only two @import calls in the deco theme are in style.css, to bring in layout.css and icons.css.
Now the question is *why* these @import calls cause trouble in Firefox, because we shouldn't have to lump all the code for deco into one giant css file like that. In fact, the css aggregator is supposed to automatically resolve the @import calls in exactly this manner for us when it generates the cached css file. We may want to re-open the relevant issue (http://drupal.org/node/113607) or create a new one, as best I can tell this is a problem with drupal core, not with deco.
Comment #10
darumaki CreditAttribution: darumaki commentedWhat do you mean by replace with code they are trying to import, can you give an example ?
Comment #11
Olarin CreditAttribution: Olarin commentedFor the call @import "layout.css" in style.css: comment it out (or delete it), then copy the entire contents of the layout.css file, and paste them into the style.css file at the point where the import call was.
Same thing for the @import "icons.css" call right after it - paste in the entire contents of the icons.css file.
If you just remove the @import calls without pasting in the relevant code, you should notice your theme breaking even worse (for instance without the code of layout.css you won't have any sidebars).
Comment #12
Olarin CreditAttribution: Olarin commentedI just posted a Drupal issue about this problem: http://drupal.org/node/317059 Hopefully someone knowledgeable can give us an explanation and/or a solution.
Comment #13
Manuel Garcia CreditAttribution: Manuel Garcia commentedthanks for that Olarin, let's cross our fingers.
Comment #14
darumaki CreditAttribution: darumaki commentedWhat I did was add the layout and icon stylesheet to the info file, it's not really a good idea to load one stylesheet with everything. A .css file should be no larger than 6-12 kb.
Comment #15
Olarin CreditAttribution: Olarin commentedCould you show exactly how to do that darumaki?
Comment #16
darumaki CreditAttribution: darumaki commentededit the .info file
add these
stylesheets[all][] = css/layout.css <--
stylesheets[all][] = css/icons.css <--
stylesheets[all][] = css/style.css
remember to remove them from the style.css
Comment #17
Olarin CreditAttribution: Olarin commentedThanks. That fix works fine for me, and is certainly much better than my original hack solution.
In the drupal issue I posted, http://drupal.org/node/317059, I basically received a response of "themes shouldn't use @import calls", and the same solution that darumaki posted here. In light of that, I'm changing this to a bug report; is there any reason darumaki's fix shouldn't just be committed as a permanent solution?
Comment #18
c31ck CreditAttribution: c31ck commentedFixed in 6.x-1.x-dev by http://drupal.org/commitlog/commit/3850/a4bf5ce7d693a7cf8af635633370dcbb...
Thank you all for your efforts.