Issue found (and resolved) with CSS comments in Border tag in Outlook 365 on MacOS 12 and 13

Jo_Pitts1
Level 10 - Community Advisor Level 10 - Community Advisor
Level 10 - Community Advisor

Today (August 28, 2023) I noticed borders on my buttons stopped rendering in Office365 on MacOS 12 and MacOS 13.  They were working fine everywhere else.  It appears be related to Microsoft's last update to Office365 Outlook for MacOS on August 22, 2023. 

 

It's not a completely generalised issue however.  The use case is pretty specific.

 

This is a situation where I use a drop down to select colors.  Rather than visible color codes, I use my trick of putting a CSS comment in front of the attribute to give a human readable value to select (i.e as follows).

Jo_Pitts1_0-1693225803576.png

When selected, the actual value is  /* VE Blue */ #17468F

 

The unrendered CSS looks like this:

 

border:2px solid ${ctaBorderColor};

 

which then renders to:

 

border:2px solid /* VE Blue */ #17468F; 

 

 

This works on all other platforms, and has just stopped working in Office 365 on MacOS 12 and MacOS 13.  Fortunately, the fix was simple.  Convert your code to do borders longhand as follows:

 

border-width:2px; border-style:solid; border-color:${ctaBorderColor}; 

 

which renders to:

 

border-width:2px; border-style:solid; border-color:/* VE Blue */ #17468F; 

 

 

Am I happy about this?  Of course not.  However, I am at least happy I found the issue early and was able to resolve. 

 

I have tested this across Email On Acid, and also on as many devices/combinations as I can.  This seems to be a solid fix.

 

So, if you've ever used my trick to give human readable attributes in front of CSS values, you can expect it to break unless you've already used the longhand approach or unless you convert your code to use the longhand approach.

 

 

 

918
2
2 Comments
Jasbir_Kaur
Level 5

Hi @Jo_Pitts1,

 

This is really great, it can solve the issues with the other email clients.

 

Did you try the gradient in the CTAs?

 

Thanks!

Jasbir

Jo_Pitts1
Level 10 - Community Advisor

@Jasbir_Kaur , I've never had a client want a gradient in a CTA so not considered it.