Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Css variable in Email Template

Tags:

css

html-email

I am making an email template and facing many issue in css. Is it a good idea to use css variable in email.

For example

:root {
  --main-bg-color: pink;
 }

 td {
  background-color: var(--main-bg-color);
 }

Is it going to break in some condition ? Should I avoid css variable in email template ?

Thank you

like image 658
Mritunjay Upadhyay Avatar asked Aug 02 '26 18:08

Mritunjay Upadhyay


1 Answers

It is better not to use css variables in email messages. Css variables are not supported in many web browsers.

Summary

For e-mail clients, it's even worse.

what I know, only a few modern email clients can handle css variables.

like image 153
G3ck Avatar answered Aug 05 '26 09:08

G3ck



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!