emogrifier
emogrifier copied to clipboard
Support to convert CSS Variables?
Hi,
Is it already possible to convert CSS variables into inline values?
For example...
- The HTML email being sent needs per-site brand colours used (eg button background).
- Have the button with a
bg-brand
class on it. - I have some CSS text being dynamically generated
- The CSS currently contains something like:
body {
--brand: #ff0000;
}
.bg-brand {
background: var(--brand);
}
.link-color {
color: var(--brand);
}
td.container {
border-color: var(--brand);
}
(this is a simplified example!).
For now, I'm going to change my code to replace var(--brand)
with something like [BRAND-COLOR]
and then string replace that with the hex code...
I'm only asking as I already have CSS elsewhere that defines these brand colour variables and it would be nice to reuse that rather than repeat the same variables in different languages in different places :)
(PS Thank for all the work on this package!)