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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jjanssen’s picture

Also, I tested disabling every single module possible (with the exception of forum and it's dependencies), and I could still reproduce this problem.

artichoke’s picture

FileSize
98.07 KB

I 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.

bengtan’s picture

Hi,

I'm working on a zen-derived theme, and I encounter a similar situation. The

  • elements in the menus (and the corresponding bullets (which are background images)) are shifted to the right by about 1em.

    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

  • dmitrig01’s picture

    Status: Active » Fixed

    I committed a fix, and a new release will come out as soon as we fix some other bugs.

    Anonymous’s picture

    Status: Fixed » Closed (fixed)
    aymerick’s picture

    Status: Closed (fixed) » Active

    dmitrig01'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 of icons.css file.

    This fixes the two issues I had on Safari:
    - font size very big
    - bad display of icons in 'recent blog posts' block.

    aymerick’s picture

    As far as I know, dmitrig01's proposed fix was that one: http://cvs.drupal.org/viewcvs/drupal/contributions/themes/zen/layout.css...

    solipsist’s picture

    We'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

    blb’s picture

    i'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. ???

    blb’s picture

    the 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.

    mariuss’s picture

    Also 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.

    JohnAlbin’s picture

    Version: 5.x-0.6 » 5.x-1.x-dev

    This 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?

    JohnAlbin’s picture

    Title: Turning on Aggregate CSS function in drupal messes up the CSS for Zen in the Safari Web browser » Enabling CSS aggregation messes up the CSS in Safari
    Status: Active » Fixed
    Anonymous’s picture

    Status: Fixed » Closed (fixed)