email/transformations/transformemailstylescolors
module
Constants
module:email/transformations/transformemailstylescolors~transformEmailStylesColorsThe transformation converts all
hsl()andhsla()colors torgb()andrgba()colors, as many email clients (e.g. Outlook) do not support the HSL notation.
Copy codehsl(120, 100%, 50%) → rgb(0, 255, 0) hsla(120, 100%, 50%, 0.5) → rgba(0, 255, 0, 0.5) hsl(120deg 100% 50% / 50%) → rgba(0, 255, 0, 0.5) linear-gradient(hsl(0, 100%, 50%), blue) → linear-gradient(rgb(255, 0, 0), blue)Colors that cannot be computed statically (e.g. containing unresolved
var(),calc()or the relative color syntaxhsl(from ...)) are left untouched.