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.
Kinda strange, works fine in every browser I've tested: IE 7, FF 2, Safari w/o CSS Aggregation. When I turn on aggregation, it only breaks in Safari. Symptoms are that the pages render, but the fonts are much too big. I first noticed this in my custom theme based off of Zen, and then I confirmed it does the same thing in the default version.
Comment | File | Size | Author |
---|---|---|---|
#8 | css-compression-safari-bug-on.jpg | 150.75 KB | solipsist |
#2 | shot-no-css-aggregation.png | 98.07 KB | artichoke |
Comments
Comment #1
jjanssen CreditAttribution: jjanssen commentedAlso, I tested disabling every single module possible (with the exception of forum and it's dependencies), and I could still reproduce this problem.
Comment #2
artichoke CreditAttribution: artichoke commentedI think this is not unique to the zen theme nor to safari.
I am encountering something similar (Drupal 5.1, PHP 4.4.5) using the aberdeen-liquid theme (from aberdeen 5.x-1.7) (with slight local mods) and viewing with either Opera 9.10 or Firefox 1.5.0.7. Both browsers reveal the same problem.
Enabling "Aggregate and compress CSS files" causes the output to become different. (And both Opera and Firefox show the same thing.) With the CSS aggregation enabled, the site map generated by Drupal's site map module contains both browser-generated bullets and css-specified images, superimposed, in the bulleted list of the site map. Also the spacing to the left of the menu items near the left of the screen changes.
Please see screenshots at;
http://www.rahul.net/dhesi/drupal-css-aggregation/shot-no-css-aggregatio...
http://www.rahul.net/dhesi/drupal-css-aggregation/shot-with-css-aggregat...
Since the difference in behavior looks exactly the same in both browsers, I doubt that it's caused by a browser issue.
Both screens validate as valid XHTML 1.0 strict and CSS 2.1, as tested at with validator.w3.org.
I also tried the native aberdeen-liquid theme without my local mods. The placement of the bullets and graphics in the site map list is difference, but both still occur when CSS file aggregation is in effect. So I don't think it's my local mods that caused the problem.
- Rahul
P.S. I tried to upload both screenshots via this Drupal form, but it will take only one unique upload(?). So I put both screenshots on a web site as given above.
Comment #3
bengtan CreditAttribution: bengtan commentedHi,
I'm working on a zen-derived theme, and I encounter a similar situation. The
Did some investigation, and found out that it's caused by the fact that Zen's style.css imports layout.css and icons.css outside of the CSS aggregation system ie. it isn't using drupal_add_css. This is probably confusing the CSS aggregator.
I replaced the line
@import "icons.css";
with the contents of icons.css and the extra shifting went away when I disabled-and-re-enabled the CSS aggregator.
You might want to try something similar with your respective sites and see whether the problem goes away.
Ta all,
Beng
Comment #4
dmitrig01 CreditAttribution: dmitrig01 commentedI committed a fix, and a new release will come out as soon as we fix some other bugs.
Comment #5
(not verified) CreditAttribution: commentedComment #6
aymerick CreditAttribution: aymerick commenteddmitrig01's change doesn't fix the issue.
The real issue is that all
@import
instructions in css files are moved to the top of the final aggregated css file, and this causes a side effect issue on safari.Which one ? I don't know, but the only known solution is to edit
style.css
file and replace the line@import "icons.css";
with the content oficons.css
file.This fixes the two issues I had on Safari:
- font size very big
- bad display of icons in 'recent blog posts' block.
Comment #7
aymerick CreditAttribution: aymerick commentedAs far as I know, dmitrig01's proposed fix was that one: http://cvs.drupal.org/viewcvs/drupal/contributions/themes/zen/layout.css...
Comment #8
solipsist CreditAttribution: solipsist commentedWe're having the same problem with sites that use our own CSSCK (CSS Construction Kit) CSS framework. Enabling "Aggregate CSS" breaks several aspects of the site's design in Safari. I've attached a screenshot to illustrate.
Live site is here: http://www.kraftriket.se
Comment #9
blb CreditAttribution: blb commentedi'm having the same problem. the zen theme in this version doesn't use the imports in the style.css that are described in the problem or the fix suggested above. ???
Comment #10
blb CreditAttribution: blb commentedthe culprit seems to be the charset declarations which end up in the middle of the file after compression and stop safari from interpreting the rest (because by standards they can only appear at the begining of the file).
http://drupal.org/node/150759 has details on the issue and a patch for common.inc to filter out the problems.
Comment #11
mariuss CreditAttribution: mariuss commentedAlso have a look at this issue:
http://drupal.org/node/172830
Basically CSS aggregation will break URLs starting with /
It may or may not be part of your problem.
Comment #12
JohnAlbinThis is a bug in Drupal core, not in Zen. And it has been fixed in http://drupal.org/node/150759 and will be released with Drupal 5.3.
In the interim, the work-around is to remove the
@CHARSET "UTF-8";
declarations from the top of the CSS files. My understanding is that some buggy editors (like Eclipse) won’t properly read a UTF-8 encoded CSS file.However, since Zen’s CSS files don’t have any UTF-8 characters, we don’t really need the
@CHARSET
declarations.Any objections to me committing a change that removes the
@CHARSET
declarations?Comment #13
JohnAlbinComment #14
(not verified) CreditAttribution: commented