PreMailer.Net icon indicating copy to clipboard operation
PreMailer.Net copied to clipboard

Two same CSS properties on same dom element does not work

Open seawerst opened this issue 2 years ago • 3 comments

This code is perfectly valid CSS:

 .emailsender {
    font-size: medium;
    font-size: max(16px, 1rem);
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%; width: 100%;
}

but because there are two of the same properties (font-size), Premailer will only take the second one and ignore the first one.

seawerst avatar Oct 04 '23 01:10 seawerst

Hi @seawerst

Are you expecting it do add both for a graceful fallback when max is not supported?

Thanks!

jasekiw avatar Oct 04 '23 19:10 jasekiw

@jasekiw Yes, and I understand that this is not a simple ask, the CssAttributeCollection class has a key uniqueness build into it.

seawerst avatar Oct 06 '23 02:10 seawerst

@seawerst The part that I'm thinking about is how many entries for a property should be inlined? CSS properties can be overridden many times. Including them all could cause the size of the email to inflate. I imagine there needs to be some sort of cutoff if the library were to be changed to allow this functionality.

jasekiw avatar Nov 24 '23 18:11 jasekiw