Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Premailer inline css ordering is different across machines #361

Open
cpoo22 opened this issue Apr 17, 2018 · 4 comments
Open

Premailer inline css ordering is different across machines #361

cpoo22 opened this issue Apr 17, 2018 · 4 comments

Comments

@cpoo22
Copy link

cpoo22 commented Apr 17, 2018

When upgrading premailer-rails from 1.9.2 (premailer 1.8.6) to 1.10.2 (premailer 1.11.1) the order of the inlined styles changed on different machines.

For a regression spec that creates an email and then checks the HTML part on my local (MAC) I have

<td class="font-light font-12 footer" bgcolor="#262626" style="color: #FFFFFF; padding: 20px 30px; font-family: museo-sans-rounded, helvetica, arial; font-size: 12px; line-height: 1.67; border-top-width: 7px; border-top-color: #6F58A2; border-top-style: solid; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt;">

But when the spec is run on semaphore I get a failure with

<td class="font-light font-12 footer" bgcolor="#262626" style="color: #FFFFFF; font-family: museo-sans-rounded, helvetica, arial; font-size: 12px; line-height: 1.67; border-top-width: 7px; border-top-color: #6F58A2; border-top-style: solid; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt; padding: 20px 30px;">

You can see that the padding has moved to the end. This random ordering is making writing regression test difficult.

@meowsus
Copy link
Collaborator

meowsus commented Sep 19, 2019

Though I'm not sure what has caused the ordering to change, I'm not sure that this is an actual bug with the software. The order of CSS in an on-line style attribute shouldn't have an effect on the rendered email, visually speaking, unless, of course, you have duplicate properties being output.

Since this issue is old and since it should be possible to write a test that does not assert the order of the style attribute value in your project, I'm going to close this.

Feel free to reopen if you disagree :)

@meowsus meowsus closed this as completed Sep 19, 2019
@meowsus
Copy link
Collaborator

meowsus commented Sep 19, 2019

Though I'm not sure what has caused the ordering to change, I'm not sure that this is an actual bug with the software. The order of CSS in an on-line style attribute shouldn't have an effect on the rendered email, visually speaking, unless, of course, you have duplicate properties being output.

Since this issue is old and since it should be possible to write a test that does not assert the order of the style attribute value in your project, I'm going to close this.

Feel free to reopen if you disagree :)

@foxyblocks
Copy link

I've encountered this issue. We have tests that spit out html results of emails that we commit to the repository. This allows us to see previews in source control as well as diff them during CI to catch un-intended regressions. They are breaking due to the order change.

It may be that we shouldn't be testing this but I think it's also true that we'd want html rendering to be predictable.

Is there a possible fix?

@meowsus
Copy link
Collaborator

meowsus commented Jun 25, 2020

@foxyblocks I'm sure that there is a possible fix. I'll reopen this issue, but don't have the bandwidth right now to take it on. If you have some time, would you be able to look into it? Even writing a failing test that showcases the bug would be useful in triaging.

@meowsus meowsus reopened this Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants