Here's a pretty typical scenario:
- "Include site style sheets" is enabled (by default).
- "Optimize CSS files" is turned on (a best practice for optimization).
-
In this scenario, Mime Mail will never include the CSS contained in the optimized CSS files. The reason is that Drupal uses file_create_path() to embed the absolute URL to the CSS file, and template_preprocess_mimemail_message() will only scrape stylesheets which start with the base path ("/" in most installations).
The attached patch adjusts the regex to match stylesheets which start with the full url or simply the base path. For example, if the base url was "http://example.com" and the base path was "/", it will match the following:
/sites/default/themes/mytheme/styles.css
http://example.com/sites/default/files/css/css_a8eb6397fb52e26ce134105966d423fb.css
Comments
Comment #1
joelstein commentedSorry, this is not just when compressing. Adjusting the title.
Comment #2
sgabe commentedI can't reproduce. As I see drupal_get_css() uses base_path() as well.
Comment #3
sgabe commentedSeems to be valid, patch committed, thanks!