Closed (fixed)
Project:
Mime Mail
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
12 May 2010 at 02:12 UTC
Updated:
26 Sep 2010 at 17:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
seren10pity commentedsubscribing,
I hve the same problem.
A solution would be to define one specific css for the newsletter css compressor, instead of all css of the website. this way, descendent selectors wouldn't be so essentials; and the newsletter wouldn't be polluted by all the other css properties that are note concerning it. and it would be lighter.
;)
Comment #2
sgabe commented@seren10pity:
You can use a custom mail.css placed in your theme folder, instead of the site style sheets.
Comment #3
sgabe commentedThe CSS Compressor is based on Emogrifier and the code in the module needs to be updated. After a quick test with -Mania-'s example, it seems for me the latest version supports descendant selectors.
I am attaching a patch with the updated code. Please, test it and report back.
Comment #4
sgabe commentedAttaching new patch against current HEAD.
Note that there is another related issue: #517306: Mime Mail Compress mangles absolute URLs in CSS properties
Comment #5
sgabe commentedRerolled patch after alpha5 for HEAD.
Comment #6
sgabe commentedPlease ignore the previous patch.
Comment #7
smk-ka commentedCan you explain why you left the encoding detection in but don't apply it to $doc anymore, like the original emogrifier.php does?
Can we move this to the top of the function, please? Like so:
$matches[2][$key] is now $value['attributes'].
In the original emogrifier the order is new overwrites old styles. Can you explain why you left the current behavior?
I know both have disadvantages: new over old doesn't keep CSS styles set in the style attribute, i.e. CSS selectors always overwrite existing styles (which is against the specs).
The current behavior, old over new, on the other side, means having to write CSS selectors in upside-down flipped order, which is very counter-intuitive.
strtolower() around $k is missing here.
Whitespace before and semicolon after "display:none" doesn't exist in original emogrifier.
Can we make this sort_by_selector_precedence(), please?
This has been changed to
list($key, $value) = explode(':', $def, 2);in the original emogrifier.Powered by Dreditor.
Comment #8
smk-ka commentedI should note that with explain I meant add a comment/reference to a Drupal issue, if there is any. Otherwise nobody knows where the differences are coming from in the long run.
Comment #9
smk-ka commentedComment #10
sgabe commentedThanks for reviewing, I see I missed some things. So, I am attaching a new patch regarding your comment.
compress()sort_by_selector_precedence()would be unnecessary verbose.Comment #11
sgabe commentedComment #12
sgabe commentedChanged title to a more descriptive one. Attached a new patch with a bug fix (unnecessary bracket breaks it totally).
Comment #13
sgabe commentedCommitted to HEAD.