The drupal_load_stylesheet function does something bad with the mail.css code (if i paste the css code directly in the template file, instead using the $css variable, everything works fine).
If i put my CSS-code in the W3C CSS Validator, everything is fine. If i put the "optimized" CSS-code in the Validator i get parse errors.

Could you please add an option in the Mimemail settings to turn this "optimization" on or off?

It´s up to: modules\contrib\mimemail\theme\mimemail.theme.inc <-- line 85

$css .= drupal_load_stylesheet($style, TRUE);

Should be

$css .= drupal_load_stylesheet($style, FALSE);

or even better and compatible to the current options:

$css .= drupal_load_stylesheet($style, variable_get('mimemail_setting_drupal_load_stylesheet_optimize'), TRUE);

as new option.

If you agree and there is an active maintainer willing to apply it, we can create a patch of course!
Please reply.

Thank you :)

Comments

thomas.frobieter’s picture

Issue summary: View changes
Anybody’s picture

I can confirm that this problem exists. The new option is a feature request but the result of the problem is a bug.
+1 for this.

Is there an active maintainer?

sgabe’s picture

If this is a bug, then we should fix it instead of going around it...

Is there an issue for Drupal core regarding this bug?

Anybody’s picture

Well I think this may be related: #1686178: CSS compressor destroys valid css "content" attribute values

But I'm not sure yet. @thomas.frobieter, can you find out which exact statement leads to the problem and if it may be related to the issue above?

Anyway @sgabe: Should't we allow to process the CSS without compression? (As module setting or variable?)

Anybody’s picture

The problem is now open since six month without any progress. We should take this forward because the problem still exists.
From my point of view it would be absolutely okay to add a setting to disable optimization PLUS we should find out if the problem behind can be fixed (which can not be done within the module I think).

How shell we proceed?

sgabe’s picture

As a workaround, let's just add an option to disable optimization on the administration interface.

Anybody’s picture

Whao that would be great!
Will you add that option? Do you need any help? Of course I'm willing to test.

Thank you so much!! :)

hass’s picture

If this is a whitespace you can easily replace the whitedpace with unicode characters and the issue is solved.

TR’s picture

Version: 7.x-1.0-beta3 » 7.x-1.x-dev
Status: Active » Postponed

This is an issue with core, not with Mime Mail. It was fixed in Drupal core D8 and D9 by #936316: CSS aggregation strips some essential whitespace within strings, but was never backported to core Drupal D7 - that is supposed to be done by #2877131: [D7] CSS aggregation strips some essential whitespace within strings.

If this issue affects you, please contribute in #2877131: [D7] CSS aggregation strips some essential whitespace within strings and please use the patch there.

Marking this as "Postponed" because there's nothing we need to do in Mime Mail to fix this - it will resolve itself when core fixes the problem.

TR’s picture

Status: Postponed » Fixed

The core issue has now been committed. I am going to assume that fixed the above problem.

If the problem still happens with the current DEV version of core Drupal, feel free to reopen the issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.